Socket
Socket
Sign inDemoInstall

@gltf-transform/core

Package Overview
Dependencies
Maintainers
1
Versions
205
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gltf-transform/core - npm Package Compare versions

Comparing version 3.0.4 to 3.1.0

12

dist/properties/node.d.ts

@@ -88,7 +88,13 @@ import { PropertyType, mat4, vec3, vec4, Nullable } from '../constants.js';

listChildren(): Node[];
/** @deprecated Use {@link Node.getParentNode} and {@link listNodeScenes} instead. */
getParent(): SceneNode | null;
/**
* Returns the unique parent ({@link Scene}, {@link Node}, or null) of this node in the scene
* hierarchy. Unrelated to {@link Property.listParents}, which lists all resource references.
* Returns the Node's unique parent Node within the scene graph. If the
* Node has no parents, or is a direct child of the {@link Scene}
* ("root node"), this method returns null.
*
* Unrelated to {@link Property.listParents}, which lists all resource
* references from properties of any type ({@link Skin}, {@link Root}, ...).
*/
getParent(): SceneNode | null;
getParentNode(): Node | null;
/**********************************************************************************************

@@ -95,0 +101,0 @@ * Attachments.

{
"name": "@gltf-transform/core",
"version": "3.0.4",
"version": "3.1.0",
"repository": "github:donmccurdy/glTF-Transform",

@@ -54,3 +54,3 @@ "homepage": "https://gltf-transform.donmccurdy.com/",

},
"gitHead": "8697c45f31638ec9bc513db82628376305f266af"
"gitHead": "841cc42c4bc61594c1712e0aaf9545ffce5600b2"
}

@@ -45,4 +45,3 @@ # @gltf-transform/core

```typescript
// Import default functions.
import { prune, dedup } from '@gltf-transform/functions';
import { resample, prune, dedup, draco, textureCompress } from '@gltf-transform/functions';
import * as sharp from 'sharp'; // Node.js only.

@@ -49,0 +48,0 @@

@@ -54,3 +54,3 @@ import { multiply } from 'gl-matrix/mat4';

/** @internal Internal reference to node's parent, omitted from {@link Graph}. */
public _parent: SceneNode | null = null;
public _parentNode: Node | null = null;

@@ -164,3 +164,3 @@ protected init(): void {

// eslint-disable-next-line @typescript-eslint/no-this-alias
for (let node: SceneNode | null = this; node instanceof Node; node = node._parent) {
for (let node: Node | null = this; node != null; node = node._parentNode) {
ancestors.push(node);

@@ -186,3 +186,3 @@ }

// Remove existing parent.
if (child._parent) child._parent.removeChild(child);
if (child._parentNode) child._parentNode.removeChild(child);

@@ -194,6 +194,6 @@ // Edge in graph.

// TODO(cleanup): Avoid using $attributes here?
child._parent = this;
child._parentNode = this;
const childrenRefs = this[$attributes]['children'];
const ref = childrenRefs[childrenRefs.length - 1];
ref.addEventListener('dispose', () => (child._parent = null));
ref.addEventListener('dispose', () => (child._parentNode = null));
return this;

@@ -212,8 +212,19 @@ }

/** @deprecated Use {@link Node.getParentNode} and {@link listNodeScenes} instead. */
public getParent(): SceneNode | null {
if (this._parentNode) return this._parentNode;
const scene = this.listParents().find((parent) => parent.propertyType === PropertyType.SCENE);
return (scene as unknown as SceneNode) || null;
}
/**
* Returns the unique parent ({@link Scene}, {@link Node}, or null) of this node in the scene
* hierarchy. Unrelated to {@link Property.listParents}, which lists all resource references.
* Returns the Node's unique parent Node within the scene graph. If the
* Node has no parents, or is a direct child of the {@link Scene}
* ("root node"), this method returns null.
*
* Unrelated to {@link Property.listParents}, which lists all resource
* references from properties of any type ({@link Skin}, {@link Root}, ...).
*/
public getParent(): SceneNode | null {
return this._parent;
public getParentNode(): Node | null {
return this._parentNode;
}

@@ -220,0 +231,0 @@

import { Nullable, PropertyType } from '../constants.js';
import { $attributes } from 'property-graph';
import { ExtensibleProperty, IExtensibleProperty } from './extensible-property.js';

@@ -47,15 +46,3 @@ import type { Node } from './node.js';

public addChild(node: Node): this {
// Remove existing parent.
if (node._parent) node._parent.removeChild(node);
// Edge in graph.
this.addRef('children', node);
// Set new parent.
// TODO(cleanup): Avoid using $attributes here?
node._parent = this;
const childrenRefs = this[$attributes]['children'];
const ref = childrenRefs[childrenRefs.length - 1];
ref.addEventListener('dispose', () => (node._parent = null));
return this;
return this.addRef('children', node);
}

@@ -62,0 +49,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc