@markandre13/usd.js 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -2
- package/dist/compression/compress.js +5 -2
- package/dist/compression/compress.js.map +1 -1
- package/dist/compression/integers.js +13 -0
- package/dist/compression/integers.js.map +1 -1
- package/dist/compression/lz4.d.ts +18 -1
- package/dist/compression/lz4.js +100 -17
- package/dist/compression/lz4.js.map +1 -1
- package/dist/crate/BootStrap.js +2 -0
- package/dist/crate/BootStrap.js.map +1 -1
- package/dist/crate/Crate.d.ts +10 -1
- package/dist/crate/Crate.js +72 -8
- package/dist/crate/Crate.js.map +1 -1
- package/dist/crate/CrateDataType.d.ts +1 -1
- package/dist/crate/CrateDataType.js +3 -0
- package/dist/crate/CrateDataType.js.map +1 -1
- package/dist/crate/Field.d.ts +2 -1
- package/dist/crate/Field.js +2 -2
- package/dist/crate/Field.js.map +1 -1
- package/dist/crate/FieldSets.js +1 -0
- package/dist/crate/FieldSets.js.map +1 -1
- package/dist/crate/Fields.d.ts +2 -10
- package/dist/crate/Fields.js +35 -4
- package/dist/crate/Fields.js.map +1 -1
- package/dist/crate/ListOp.d.ts +29 -0
- package/dist/crate/ListOp.js +22 -0
- package/dist/crate/ListOp.js.map +1 -0
- package/dist/crate/Paths.d.ts +1 -1
- package/dist/crate/Paths.js +16 -2
- package/dist/crate/Paths.js.map +1 -1
- package/dist/crate/Reader.js +3 -3
- package/dist/crate/Reader.js.map +1 -1
- package/dist/crate/SpecType.d.ts +3 -3
- package/dist/crate/SpecType.js +2 -0
- package/dist/crate/SpecType.js.map +1 -1
- package/dist/crate/Specifier.d.ts +1 -1
- package/dist/crate/Specs.js +1 -0
- package/dist/crate/Specs.js.map +1 -1
- package/dist/crate/Stage.d.ts +1 -1
- package/dist/crate/Stage.js +1 -0
- package/dist/crate/Stage.js.map +1 -1
- package/dist/crate/Strings.js +5 -0
- package/dist/crate/Strings.js.map +1 -1
- package/dist/crate/Tokens.js +47 -1
- package/dist/crate/Tokens.js.map +1 -1
- package/dist/crate/ValueRep.d.ts +2 -2
- package/dist/crate/ValueRep.js +33 -6
- package/dist/crate/ValueRep.js.map +1 -1
- package/dist/crate/Variability.d.ts +1 -1
- package/dist/crate/Writer.d.ts +3 -0
- package/dist/crate/Writer.js +21 -0
- package/dist/crate/Writer.js.map +1 -1
- package/dist/detail/hexdump.js +1 -0
- package/dist/detail/hexdump.js.map +1 -1
- package/dist/nodes/attributes/AssetPathAttr.d.ts +1 -1
- package/dist/nodes/attributes/AssetPathAttr.js +1 -1
- package/dist/nodes/attributes/AssetPathAttr.js.map +1 -1
- package/dist/nodes/attributes/Attribute.d.ts +1 -1
- package/dist/nodes/attributes/Attribute.js +1 -1
- package/dist/nodes/attributes/Attribute.js.map +1 -1
- package/dist/nodes/attributes/BooleanAttr.d.ts +1 -1
- package/dist/nodes/attributes/BooleanAttr.js +1 -1
- package/dist/nodes/attributes/BooleanAttr.js.map +1 -1
- package/dist/nodes/attributes/Color3fAttr.d.ts +3 -3
- package/dist/nodes/attributes/Color3fAttr.js +1 -1
- package/dist/nodes/attributes/Color3fAttr.js.map +1 -1
- package/dist/nodes/attributes/FloatArrayAttr.d.ts +6 -0
- package/dist/nodes/attributes/FloatArrayAttr.js +18 -0
- package/dist/nodes/attributes/FloatArrayAttr.js.map +1 -0
- package/dist/nodes/attributes/FloatAttr.d.ts +1 -1
- package/dist/nodes/attributes/FloatAttr.js +1 -1
- package/dist/nodes/attributes/FloatAttr.js.map +1 -1
- package/dist/nodes/attributes/IntArrayAttr.d.ts +4 -2
- package/dist/nodes/attributes/IntArrayAttr.js +6 -2
- package/dist/nodes/attributes/IntArrayAttr.js.map +1 -1
- package/dist/nodes/attributes/Relationship.d.ts +2 -2
- package/dist/nodes/attributes/Relationship.js +1 -1
- package/dist/nodes/attributes/Relationship.js.map +1 -1
- package/dist/nodes/attributes/StringAttr.d.ts +1 -1
- package/dist/nodes/attributes/StringAttr.js +1 -1
- package/dist/nodes/attributes/StringAttr.js.map +1 -1
- package/dist/nodes/attributes/TokenAttr.d.ts +3 -3
- package/dist/nodes/attributes/TokenAttr.js +13 -3
- package/dist/nodes/attributes/TokenAttr.js.map +1 -1
- package/dist/nodes/attributes/VariabilityAttr.d.ts +1 -1
- package/dist/nodes/attributes/VariabilityAttr.js +1 -1
- package/dist/nodes/attributes/VariabilityAttr.js.map +1 -1
- package/dist/nodes/attributes/Vec2fArrayAttr.d.ts +1 -1
- package/dist/nodes/attributes/Vec2fArrayAttr.js +1 -1
- package/dist/nodes/attributes/Vec2fArrayAttr.js.map +1 -1
- package/dist/nodes/attributes/Vec3fArrayAttr.d.ts +4 -2
- package/dist/nodes/attributes/Vec3fArrayAttr.js +6 -2
- package/dist/nodes/attributes/Vec3fArrayAttr.js.map +1 -1
- package/dist/nodes/geometry/Boundable.d.ts +6 -0
- package/dist/nodes/geometry/Boundable.js +6 -0
- package/dist/nodes/geometry/Boundable.js.map +1 -1
- package/dist/nodes/geometry/Camera.d.ts +7 -2
- package/dist/nodes/geometry/Camera.js +36 -0
- package/dist/nodes/geometry/Camera.js.map +1 -1
- package/dist/nodes/geometry/GeomSubset.d.ts +67 -2
- package/dist/nodes/geometry/GeomSubset.js +101 -8
- package/dist/nodes/geometry/GeomSubset.js.map +1 -1
- package/dist/nodes/geometry/Gprim.d.ts +28 -0
- package/dist/nodes/geometry/Gprim.js +30 -0
- package/dist/nodes/geometry/Gprim.js.map +1 -1
- package/dist/nodes/geometry/Imageable.d.ts +9 -0
- package/dist/nodes/geometry/Imageable.js +9 -0
- package/dist/nodes/geometry/Imageable.js.map +1 -1
- package/dist/nodes/geometry/Mesh.d.ts +75 -10
- package/dist/nodes/geometry/Mesh.js +121 -8
- package/dist/nodes/geometry/Mesh.js.map +1 -1
- package/dist/nodes/geometry/PointBased.d.ts +20 -2
- package/dist/nodes/geometry/PointBased.js +35 -11
- package/dist/nodes/geometry/PointBased.js.map +1 -1
- package/dist/nodes/geometry/Scope.d.ts +9 -1
- package/dist/nodes/geometry/Scope.js +8 -0
- package/dist/nodes/geometry/Scope.js.map +1 -1
- package/dist/nodes/geometry/SkelBindingAPI.d.ts +70 -0
- package/dist/nodes/geometry/SkelBindingAPI.js +2 -0
- package/dist/nodes/geometry/SkelBindingAPI.js.map +1 -0
- package/dist/nodes/geometry/Xform.d.ts +6 -1
- package/dist/nodes/geometry/Xform.js +5 -0
- package/dist/nodes/geometry/Xform.js.map +1 -1
- package/dist/nodes/geometry/Xformable.d.ts +9 -3
- package/dist/nodes/geometry/Xformable.js +6 -0
- package/dist/nodes/geometry/Xformable.js.map +1 -1
- package/dist/nodes/lux/BoundableLightBase.d.ts +8 -0
- package/dist/nodes/lux/BoundableLightBase.js +8 -0
- package/dist/nodes/lux/BoundableLightBase.js.map +1 -1
- package/dist/nodes/lux/DomeLight.d.ts +11 -1
- package/dist/nodes/lux/DomeLight.js +10 -0
- package/dist/nodes/lux/DomeLight.js.map +1 -1
- package/dist/nodes/lux/NonboundableLightBase.d.ts +1 -1
- package/dist/nodes/lux/NonboundableLightBase.js +10 -1
- package/dist/nodes/lux/NonboundableLightBase.js.map +1 -1
- package/dist/nodes/lux/SphereLight.d.ts +9 -1
- package/dist/nodes/lux/SphereLight.js +8 -0
- package/dist/nodes/lux/SphereLight.js.map +1 -1
- package/dist/nodes/shader/Material.d.ts +8 -1
- package/dist/nodes/shader/Material.js +19 -0
- package/dist/nodes/shader/Material.js.map +1 -1
- package/dist/nodes/shader/NodeGraph.d.ts +7 -0
- package/dist/nodes/shader/NodeGraph.js +7 -0
- package/dist/nodes/shader/NodeGraph.js.map +1 -1
- package/dist/nodes/shader/Shader.d.ts +9 -1
- package/dist/nodes/shader/Shader.js +8 -0
- package/dist/nodes/shader/Shader.js.map +1 -1
- package/dist/nodes/shader/blender/ImageTexture.d.ts +12 -0
- package/dist/nodes/shader/blender/ImageTexture.js +59 -0
- package/dist/nodes/shader/blender/ImageTexture.js.map +1 -0
- package/dist/nodes/shader/blender/PrincipledBSDF.d.ts +14 -0
- package/dist/nodes/shader/blender/PrincipledBSDF.js +82 -0
- package/dist/nodes/shader/blender/PrincipledBSDF.js.map +1 -0
- package/dist/nodes/shader/blender/UVMap.d.ts +9 -0
- package/dist/nodes/shader/blender/UVMap.js +32 -0
- package/dist/nodes/shader/blender/UVMap.js.map +1 -0
- package/dist/nodes/skeleton/BlendShape.d.ts +21 -0
- package/dist/nodes/skeleton/BlendShape.js +46 -0
- package/dist/nodes/skeleton/BlendShape.js.map +1 -0
- package/dist/nodes/skeleton/SkelAnimation.d.ts +26 -0
- package/dist/nodes/skeleton/SkelAnimation.js +50 -0
- package/dist/nodes/skeleton/SkelAnimation.js.map +1 -0
- package/dist/nodes/skeleton/SkelRoot.d.ts +6 -1
- package/dist/nodes/skeleton/SkelRoot.js +5 -0
- package/dist/nodes/skeleton/SkelRoot.js.map +1 -1
- package/dist/nodes/skeleton/Skeleton.d.ts +51 -4
- package/dist/nodes/skeleton/Skeleton.js +51 -0
- package/dist/nodes/skeleton/Skeleton.js.map +1 -1
- package/dist/nodes/usd/PseudoRoot.d.ts +1 -1
- package/dist/nodes/usd/PseudoRoot.js +21 -1
- package/dist/nodes/usd/PseudoRoot.js.map +1 -1
- package/dist/nodes/usd/SchemaBase.d.ts +1 -1
- package/dist/nodes/usd/SchemaBase.js +1 -1
- package/dist/nodes/usd/SchemaBase.js.map +1 -1
- package/dist/nodes/usd/Typed.d.ts +10 -0
- package/dist/nodes/usd/Typed.js +10 -0
- package/dist/nodes/usd/Typed.js.map +1 -1
- package/dist/{crate → nodes/usd}/UsdNode.d.ts +21 -9
- package/dist/{crate → nodes/usd}/UsdNode.js +56 -2
- package/dist/nodes/usd/UsdNode.js.map +1 -0
- package/package.json +8 -8
- package/dist/crate/UsdNode.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Specifier } from "../../crate/Specifier";
|
|
2
|
+
import { SpecType } from "../../crate/SpecType";
|
|
3
|
+
import { Variability } from "../../crate/Variability";
|
|
4
|
+
import { IntArrayAttr } from "../attributes/IntArrayAttr";
|
|
5
|
+
import { Vec3fArrayAttr } from "../attributes/Vec3fArrayAttr";
|
|
6
|
+
import { Typed } from "../usd/Typed";
|
|
7
|
+
/**
|
|
8
|
+
* Describes a target blend shape, possibly containing inbetween shapes.
|
|
9
|
+
*
|
|
10
|
+
* defined in pxr/usd/usdSkel/schema.usda
|
|
11
|
+
*/
|
|
12
|
+
export class BlendShape extends Typed {
|
|
13
|
+
constructor(parent, name) {
|
|
14
|
+
super(parent.crate, parent, -1, name, true);
|
|
15
|
+
this.spec_type = SpecType.Prim;
|
|
16
|
+
this.specifier = Specifier.Def;
|
|
17
|
+
this.typeName = "BlendShape";
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* **Required property**. Position offsets which, when added to the
|
|
21
|
+
* base pose, provides the target shape.
|
|
22
|
+
*/
|
|
23
|
+
set offsets(value) {
|
|
24
|
+
this.deleteChild("offsets");
|
|
25
|
+
if (value !== undefined) {
|
|
26
|
+
new Vec3fArrayAttr(this, "offsets", value, "vector3f[]", Variability.Uniform);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* **Required property**. Normal offsets which, when added to the
|
|
31
|
+
* base pose, provides the normals of the target shape.
|
|
32
|
+
*/
|
|
33
|
+
set normalOffsets(value) {
|
|
34
|
+
this.deleteChild("normalOffsets");
|
|
35
|
+
if (value !== undefined) {
|
|
36
|
+
new Vec3fArrayAttr(this, "normalOffsets", value, "vector3f[]", Variability.Uniform);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
set pointIndices(value) {
|
|
40
|
+
this.deleteChild("pointIndices");
|
|
41
|
+
if (value !== undefined) {
|
|
42
|
+
new IntArrayAttr(this, "pointIndices", value, Variability.Uniform);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingUR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AAK,EAAE,YAAY,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;QACvF,CAAC;IACL,CAAC;IACD,IAAI,YAAY,CAAC,KAAoC;QACjD,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,CAAA;QAChC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACtB,IAAI,YAAY,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;QACtE,CAAC;IACL,CAAC;CACJ"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Typed } from "../usd/Typed";
|
|
2
|
+
import { UsdNode } from "../usd/UsdNode";
|
|
3
|
+
/**
|
|
4
|
+
* Describes a skel animation, where joint animation is stored in a
|
|
5
|
+
* vectorized form.
|
|
6
|
+
*
|
|
7
|
+
* defined in pxr/usd/usdSkel/schema.usda
|
|
8
|
+
*/
|
|
9
|
+
export declare class SkelAnimation extends Typed {
|
|
10
|
+
constructor(parent: UsdNode, name: string);
|
|
11
|
+
/**
|
|
12
|
+
* Array of tokens identifying which blend shapes this
|
|
13
|
+
* animation's data applies to. The tokens for blendShapes correspond to
|
|
14
|
+
* the tokens set in the *skel:blendShapes* binding property of the
|
|
15
|
+
* UsdSkelBindingAPI. Note that blendShapes does not accept time-sampled
|
|
16
|
+
* values.
|
|
17
|
+
*/
|
|
18
|
+
set blendShapes(values: string[] | undefined);
|
|
19
|
+
/**
|
|
20
|
+
* Array of weight values for each blend shape. Each weight value
|
|
21
|
+
* is associated with the corresponding blend shape identified within the
|
|
22
|
+
* *blendShapes* token array, and therefore must have the same length as
|
|
23
|
+
* *blendShapes.
|
|
24
|
+
*/
|
|
25
|
+
set blendShapeWeights(values: ArrayLike<number> | undefined);
|
|
26
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Specifier } from "../../crate/Specifier";
|
|
2
|
+
import { SpecType } from "../../crate/SpecType";
|
|
3
|
+
import { Variability } from "../../crate/Variability";
|
|
4
|
+
import { FloatArrayAttr } from "../attributes/FloatArrayAttr";
|
|
5
|
+
import { TokenAttr } from "../attributes/TokenAttr";
|
|
6
|
+
import { Typed } from "../usd/Typed";
|
|
7
|
+
/**
|
|
8
|
+
* Describes a skel animation, where joint animation is stored in a
|
|
9
|
+
* vectorized form.
|
|
10
|
+
*
|
|
11
|
+
* defined in pxr/usd/usdSkel/schema.usda
|
|
12
|
+
*/
|
|
13
|
+
export class SkelAnimation extends Typed {
|
|
14
|
+
constructor(parent, name) {
|
|
15
|
+
super(parent.crate, parent, -1, name, true);
|
|
16
|
+
this.spec_type = SpecType.Prim;
|
|
17
|
+
this.specifier = Specifier.Def;
|
|
18
|
+
this.typeName = "SkelAnimation";
|
|
19
|
+
}
|
|
20
|
+
// joints
|
|
21
|
+
// translations
|
|
22
|
+
// rotations
|
|
23
|
+
// scales
|
|
24
|
+
/**
|
|
25
|
+
* Array of tokens identifying which blend shapes this
|
|
26
|
+
* animation's data applies to. The tokens for blendShapes correspond to
|
|
27
|
+
* the tokens set in the *skel:blendShapes* binding property of the
|
|
28
|
+
* UsdSkelBindingAPI. Note that blendShapes does not accept time-sampled
|
|
29
|
+
* values.
|
|
30
|
+
*/
|
|
31
|
+
set blendShapes(values) {
|
|
32
|
+
this.deleteChild("blendShapes");
|
|
33
|
+
if (values !== undefined) {
|
|
34
|
+
new TokenAttr(this, "blendShapes", Variability.Uniform, values);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Array of weight values for each blend shape. Each weight value
|
|
39
|
+
* is associated with the corresponding blend shape identified within the
|
|
40
|
+
* *blendShapes* token array, and therefore must have the same length as
|
|
41
|
+
* *blendShapes.
|
|
42
|
+
*/
|
|
43
|
+
set blendShapeWeights(values) {
|
|
44
|
+
this.deleteChild("blendShapeWeights");
|
|
45
|
+
if (values !== undefined) {
|
|
46
|
+
new FloatArrayAttr(this, "blendShapeWeights", values);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=SkelAnimation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SkelAnimation.js","sourceRoot":"","sources":["../../../src/nodes/skeleton/SkelAnimation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAGpC;;;;;GAKG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK;IACpC,YAAY,MAAe,EAAE,IAAY;QACrC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;QAC3C,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAA;QAC9B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,GAAG,CAAA;QAC9B,IAAI,CAAC,QAAQ,GAAG,eAAe,CAAA;IACnC,CAAC;IAED,SAAS;IACT,eAAe;IACf,YAAY;IACZ,SAAS;IAET;;;;;;OAMG;IACH,IAAI,WAAW,CAAC,MAA4B;QACxC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,CAAA;QAC/B,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACvB,IAAI,SAAS,CAAC,IAAI,EAAE,aAAa,EAAE,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;QACnE,CAAC;IACL,CAAC;IACD;;;;;OAKG;IACH,IAAI,iBAAiB,CAAC,MAAqC;QACvD,IAAI,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAA;QACrC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACvB,IAAI,cAAc,CAAC,IAAI,EAAE,mBAAmB,EAAE,MAAM,CAAC,CAAA;QACzD,CAAC;IACL,CAAC;CACJ"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import type { UsdNode } from "
|
|
1
|
+
import type { UsdNode } from "../usd/UsdNode";
|
|
2
2
|
import { Boundable } from "../geometry/Boundable";
|
|
3
|
+
/**
|
|
4
|
+
* Concrete prim schema for a transform, which implements Xformable
|
|
5
|
+
*
|
|
6
|
+
* defined in pxr/usd/usdSkel/schema.usda
|
|
7
|
+
*/
|
|
3
8
|
export declare class SkelRoot extends Boundable {
|
|
4
9
|
constructor(parent: UsdNode, name: string);
|
|
5
10
|
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { Specifier } from "../../crate/Specifier";
|
|
2
2
|
import { SpecType } from "../../crate/SpecType";
|
|
3
3
|
import { Boundable } from "../geometry/Boundable";
|
|
4
|
+
/**
|
|
5
|
+
* Concrete prim schema for a transform, which implements Xformable
|
|
6
|
+
*
|
|
7
|
+
* defined in pxr/usd/usdSkel/schema.usda
|
|
8
|
+
*/
|
|
4
9
|
export class SkelRoot extends Boundable {
|
|
5
10
|
constructor(parent, name) {
|
|
6
11
|
super(parent.crate, parent, -1, name, true);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SkelRoot.js","sourceRoot":"","sources":["../../../src/nodes/skeleton/SkelRoot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAE/C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"SkelRoot.js","sourceRoot":"","sources":["../../../src/nodes/skeleton/SkelRoot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAE/C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD;;;;GAIG;AACH,MAAM,OAAO,QAAS,SAAQ,SAAS;IACnC,YAAY,MAAe,EAAE,IAAY;QACrC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;QAC3C,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAA;QAC9B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,GAAG,CAAA;QAC9B,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAA;IAC9B,CAAC;CACJ"}
|
|
@@ -1,11 +1,58 @@
|
|
|
1
|
-
import type { UsdNode } from "
|
|
1
|
+
import type { UsdNode } from "../usd/UsdNode";
|
|
2
2
|
import { Boundable } from "../geometry/Boundable";
|
|
3
|
+
import { ListOp } from "../../crate/ListOp";
|
|
4
|
+
import { SkelAnimation } from "./SkelAnimation";
|
|
5
|
+
/**
|
|
6
|
+
* Describes a skeleton.
|
|
7
|
+
*
|
|
8
|
+
* defined in pxr/usd/usdSkel/schema.usda
|
|
9
|
+
*/
|
|
3
10
|
export declare class Skeleton extends Boundable {
|
|
4
11
|
constructor(parent: UsdNode, name: string);
|
|
5
12
|
encodeFields(): void;
|
|
13
|
+
/**
|
|
14
|
+
* An array of path tokens identifying the set of joints that make
|
|
15
|
+
* up the skeleton, and their order. Each token in the array must be valid
|
|
16
|
+
* when parsed as an SdfPath. The parent-child relationships of the
|
|
17
|
+
* corresponding paths determine the parent-child relationships of each
|
|
18
|
+
* joint. It is not required that the name at the end of each path be
|
|
19
|
+
* unique, but rather only that the paths themselves be unique.
|
|
20
|
+
*
|
|
21
|
+
* e.g. a skeleton of
|
|
22
|
+
*
|
|
23
|
+
* root -> spine05 -> spinge04
|
|
24
|
+
*
|
|
25
|
+
* will have it's joints listed as
|
|
26
|
+
*
|
|
27
|
+
* ["root", "root/spine05", "root/spine05/spine04"]
|
|
28
|
+
*/
|
|
6
29
|
set joints(value: string[] | undefined);
|
|
30
|
+
/**
|
|
31
|
+
* If authored, provides a unique name per joint. This may be
|
|
32
|
+
* optionally set to provide better names when translating to DCC apps
|
|
33
|
+
* that require unique joint names.
|
|
34
|
+
*/
|
|
7
35
|
set jointNames(value: string[] | undefined);
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Specifies the bind-pose transforms of each joint in
|
|
38
|
+
* **world space**, in the ordering imposed by _joints_.
|
|
39
|
+
*/
|
|
40
|
+
set bindTransforms(value: ArrayLike<number> | undefined);
|
|
41
|
+
/**
|
|
42
|
+
* Specifies the rest-pose transforms of each joint in
|
|
43
|
+
* **local space**, in the ordering imposed by *joints*. This provides
|
|
44
|
+
* fallback values for joint transforms when a Skeleton either has no
|
|
45
|
+
* bound animation source, or when that animation source only contains
|
|
46
|
+
* animation for a subset of a Skeleton's joints.
|
|
47
|
+
*/
|
|
48
|
+
set restTransforms(value: ArrayLike<number> | undefined);
|
|
49
|
+
/**
|
|
50
|
+
* Useful when exporting to Blender to indicate the length of leaf bones.
|
|
51
|
+
*/
|
|
52
|
+
set blenderBoneLength(value: ArrayLike<number> | undefined);
|
|
53
|
+
/**
|
|
54
|
+
* Animation source to be bound to Skeleton primitives at or
|
|
55
|
+
* beneath the location at which this property is defined.
|
|
56
|
+
*/
|
|
57
|
+
set animationSource(value: ListOp<SkelAnimation> | undefined);
|
|
11
58
|
}
|
|
@@ -3,6 +3,12 @@ import { SpecType } from "../../crate/SpecType";
|
|
|
3
3
|
import { Variability } from "../../crate/Variability";
|
|
4
4
|
import { Attribute } from "../attributes/Attribute";
|
|
5
5
|
import { Boundable } from "../geometry/Boundable";
|
|
6
|
+
import { Relationship } from "../attributes/Relationship";
|
|
7
|
+
/**
|
|
8
|
+
* Describes a skeleton.
|
|
9
|
+
*
|
|
10
|
+
* defined in pxr/usd/usdSkel/schema.usda
|
|
11
|
+
*/
|
|
6
12
|
export class Skeleton extends Boundable {
|
|
7
13
|
constructor(parent, name) {
|
|
8
14
|
super(parent.crate, parent, -1, name, true);
|
|
@@ -16,6 +22,22 @@ export class Skeleton extends Boundable {
|
|
|
16
22
|
prepend: ["SkelBindingAPI"]
|
|
17
23
|
});
|
|
18
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* An array of path tokens identifying the set of joints that make
|
|
27
|
+
* up the skeleton, and their order. Each token in the array must be valid
|
|
28
|
+
* when parsed as an SdfPath. The parent-child relationships of the
|
|
29
|
+
* corresponding paths determine the parent-child relationships of each
|
|
30
|
+
* joint. It is not required that the name at the end of each path be
|
|
31
|
+
* unique, but rather only that the paths themselves be unique.
|
|
32
|
+
*
|
|
33
|
+
* e.g. a skeleton of
|
|
34
|
+
*
|
|
35
|
+
* root -> spine05 -> spinge04
|
|
36
|
+
*
|
|
37
|
+
* will have it's joints listed as
|
|
38
|
+
*
|
|
39
|
+
* ["root", "root/spine05", "root/spine05/spine04"]
|
|
40
|
+
*/
|
|
19
41
|
set joints(value) {
|
|
20
42
|
this.deleteChild("joints");
|
|
21
43
|
if (value !== undefined) {
|
|
@@ -26,6 +48,11 @@ export class Skeleton extends Boundable {
|
|
|
26
48
|
});
|
|
27
49
|
}
|
|
28
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* If authored, provides a unique name per joint. This may be
|
|
53
|
+
* optionally set to provide better names when translating to DCC apps
|
|
54
|
+
* that require unique joint names.
|
|
55
|
+
*/
|
|
29
56
|
set jointNames(value) {
|
|
30
57
|
this.deleteChild("jointNames");
|
|
31
58
|
if (value !== undefined) {
|
|
@@ -36,6 +63,10 @@ export class Skeleton extends Boundable {
|
|
|
36
63
|
});
|
|
37
64
|
}
|
|
38
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Specifies the bind-pose transforms of each joint in
|
|
68
|
+
* **world space**, in the ordering imposed by _joints_.
|
|
69
|
+
*/
|
|
39
70
|
set bindTransforms(value) {
|
|
40
71
|
this.deleteChild("bindTransforms");
|
|
41
72
|
if (value !== undefined) {
|
|
@@ -46,6 +77,13 @@ export class Skeleton extends Boundable {
|
|
|
46
77
|
});
|
|
47
78
|
}
|
|
48
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Specifies the rest-pose transforms of each joint in
|
|
82
|
+
* **local space**, in the ordering imposed by *joints*. This provides
|
|
83
|
+
* fallback values for joint transforms when a Skeleton either has no
|
|
84
|
+
* bound animation source, or when that animation source only contains
|
|
85
|
+
* animation for a subset of a Skeleton's joints.
|
|
86
|
+
*/
|
|
49
87
|
set restTransforms(value) {
|
|
50
88
|
this.deleteChild("restTransforms");
|
|
51
89
|
if (value !== undefined) {
|
|
@@ -56,6 +94,9 @@ export class Skeleton extends Boundable {
|
|
|
56
94
|
});
|
|
57
95
|
}
|
|
58
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Useful when exporting to Blender to indicate the length of leaf bones.
|
|
99
|
+
*/
|
|
59
100
|
set blenderBoneLength(value) {
|
|
60
101
|
this.deleteChild("primvars:blender:bone_lengths");
|
|
61
102
|
new Attribute(this, "primvars:blender:bone_lengths", (node) => {
|
|
@@ -64,5 +105,15 @@ export class Skeleton extends Boundable {
|
|
|
64
105
|
node.setFloatArray("default", value);
|
|
65
106
|
});
|
|
66
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* Animation source to be bound to Skeleton primitives at or
|
|
110
|
+
* beneath the location at which this property is defined.
|
|
111
|
+
*/
|
|
112
|
+
set animationSource(value) {
|
|
113
|
+
this.deleteChild("skel:animationSource");
|
|
114
|
+
if (value !== undefined) {
|
|
115
|
+
new Relationship(this, "skel:animationSource", value);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
67
118
|
}
|
|
68
119
|
//# sourceMappingURL=Skeleton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Skeleton.js","sourceRoot":"","sources":["../../../src/nodes/ske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1
|
import { SpecType } from "../../crate/SpecType";
|
|
2
|
-
import { UsdNode } from "
|
|
2
|
+
import { UsdNode } from "./UsdNode";
|
|
3
|
+
// blender mesh options and how they map to usd
|
|
4
|
+
// shade: flat | smooth
|
|
5
|
+
// 'normals' are not per 'points' but 'faceVertexIndices'
|
|
6
|
+
// and the flat/smooth is encoded via those
|
|
7
|
+
// edge > mark sharp
|
|
8
|
+
// edge > mark seam (i guess this is for uv?)
|
|
9
|
+
// edge > bevel weight
|
|
10
|
+
// edge > edge crease
|
|
11
|
+
//
|
|
12
|
+
// materials
|
|
13
|
+
// multiple materials for one mesh
|
|
14
|
+
// via GeomSubset which lists the faces
|
|
15
|
+
// viewport display is not stored but taken from color itself during import
|
|
16
|
+
// armature, weights
|
|
17
|
+
// blendshape
|
|
18
|
+
// subdivision modifier becomes part of the Mesh... but might loose sharp edges (?)
|
|
3
19
|
export class PseudoRoot extends UsdNode {
|
|
20
|
+
// timeCodesPerSecond = 24
|
|
21
|
+
// framesPerSecond = 12
|
|
22
|
+
// endTimeCode = 240
|
|
23
|
+
// startTimeCode = 1
|
|
4
24
|
constructor(crate) {
|
|
5
25
|
super(crate, undefined, -1, "/", true);
|
|
6
26
|
this.metersPerUnit = 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PseudoRoot.js","sourceRoot":"","sources":["../../../src/nodes/usd/PseudoRoot.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"PseudoRoot.js","sourceRoot":"","sources":["../../../src/nodes/usd/PseudoRoot.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,+CAA+C;AAC/C,yBAAyB;AACzB,6DAA6D;AAC7D,+CAA+C;AAC/C,sBAAsB;AACtB,+CAA+C;AAC/C,wBAAwB;AACxB,uBAAuB;AACvB,EAAE;AACF,cAAc;AACd,sCAAsC;AACtC,6CAA6C;AAC7C,iFAAiF;AACjF,sBAAsB;AACtB,eAAe;AACf,qFAAqF;AAErF,MAAM,OAAO,UAAW,SAAQ,OAAO;IAMnC,0BAA0B;IAC1B,uBAAuB;IACvB,oBAAoB;IACpB,oBAAoB;IAEpB,YAAY,KAAY;QACpB,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;QAX1C,kBAAa,GAAY,CAAC,CAAC;QAE3B,WAAM,GAAqB,GAAG,CAAC;QAU3B,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC,UAAU,CAAA;IACxC,CAAC;IAEQ,YAAY;QACjB,KAAK,CAAC,YAAY,EAAE,CAAA;QACpB,IAAI,CAAC,SAAS,CAAC,eAAe,EAAE,IAAI,CAAC,aAAa,CAAC,CAAA;QACnD,IAAI,CAAC,SAAS,CAAC,eAAe,EAAE,IAAI,CAAC,aAAa,CAAC,CAAA;QACnD,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;QACpC,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC,WAAW,CAAC,CAAA;IAClD,CAAC;CACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaBase.js","sourceRoot":"","sources":["../../../src/nodes/usd/SchemaBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"SchemaBase.js","sourceRoot":"","sources":["../../../src/nodes/usd/SchemaBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,MAAM,OAAO,UAAW,SAAQ,OAAO;CAAI"}
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import type { Specifier } from "../../crate/Specifier";
|
|
2
2
|
import { SchemaBase } from "./SchemaBase";
|
|
3
|
+
/**
|
|
4
|
+
* The base class for all _typed_ schemas (those that can impart a
|
|
5
|
+
* typeName to a UsdPrim), and therefore the base class for all
|
|
6
|
+
* concrete, instantiable "IsA" schemas.
|
|
7
|
+
*
|
|
8
|
+
* UsdTyped implements a typeName-based query for its override of
|
|
9
|
+
* UsdSchemaBase::_IsCompatible(). It provides no other behavior.
|
|
10
|
+
*
|
|
11
|
+
* defined in pxr/usd/usd/schema.usda
|
|
12
|
+
*/
|
|
3
13
|
export declare class Typed extends SchemaBase {
|
|
4
14
|
protected specifier?: Specifier;
|
|
5
15
|
protected typeName?: string;
|
package/dist/nodes/usd/Typed.js
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import { SchemaBase } from "./SchemaBase";
|
|
2
|
+
/**
|
|
3
|
+
* The base class for all _typed_ schemas (those that can impart a
|
|
4
|
+
* typeName to a UsdPrim), and therefore the base class for all
|
|
5
|
+
* concrete, instantiable "IsA" schemas.
|
|
6
|
+
*
|
|
7
|
+
* UsdTyped implements a typeName-based query for its override of
|
|
8
|
+
* UsdSchemaBase::_IsCompatible(). It provides no other behavior.
|
|
9
|
+
*
|
|
10
|
+
* defined in pxr/usd/usd/schema.usda
|
|
11
|
+
*/
|
|
2
12
|
export class Typed extends SchemaBase {
|
|
3
13
|
encodeFields() {
|
|
4
14
|
super.encodeFields();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typed.js","sourceRoot":"","sources":["../../../src/nodes/usd/Typed.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"Typed.js","sourceRoot":"","sources":["../../../src/nodes/usd/Typed.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC;;;;;;;;;GASG;AACH,MAAM,OAAO,KAAM,SAAQ,UAAU;IAIxB,YAAY;QACjB,KAAK,CAAC,YAAY,EAAE,CAAA;QACpB,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;QAC9C,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;IAC5C,CAAC;CACJ"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Crate } from "
|
|
2
|
-
import { SpecType } from "
|
|
3
|
-
import type { Tokens } from "
|
|
4
|
-
import { ValueRep } from "
|
|
5
|
-
import type { Specifier } from "
|
|
6
|
-
import type { ListOp } from "
|
|
7
|
-
import type { Variability } from "
|
|
1
|
+
import { Crate } from "../../crate/Crate";
|
|
2
|
+
import { SpecType } from "../../crate/SpecType";
|
|
3
|
+
import type { Tokens } from "../../crate/Tokens";
|
|
4
|
+
import { ValueRep } from "../../crate/ValueRep.js";
|
|
5
|
+
import type { Specifier } from "../../crate/Specifier";
|
|
6
|
+
import type { ListOp } from "../../crate/ListOp";
|
|
7
|
+
import type { Variability } from "../../crate/Variability";
|
|
8
8
|
export interface UsdNodeSerializeArgs {
|
|
9
9
|
tokens: Tokens;
|
|
10
10
|
thisIndex: number;
|
|
@@ -13,6 +13,12 @@ export interface UsdNodeSerializeArgs {
|
|
|
13
13
|
jumps: number[];
|
|
14
14
|
depth: number;
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* USD stores it's data in a tree of UsdNodes.
|
|
18
|
+
*
|
|
19
|
+
* - a node has fields encoded as ValueReps
|
|
20
|
+
* -
|
|
21
|
+
*/
|
|
16
22
|
export declare class UsdNode {
|
|
17
23
|
crate: Crate;
|
|
18
24
|
parent?: UsdNode;
|
|
@@ -24,9 +30,13 @@ export declare class UsdNode {
|
|
|
24
30
|
name: string;
|
|
25
31
|
prim: boolean;
|
|
26
32
|
constructor(crate: Crate, parent: UsdNode | undefined, index: number, name: string, prim: boolean);
|
|
33
|
+
/**
|
|
34
|
+
* encode node into the various sections of the crate
|
|
35
|
+
*/
|
|
27
36
|
encode(): void;
|
|
28
37
|
encodeFields(): void;
|
|
29
38
|
deleteChild(name: string): void;
|
|
39
|
+
findChild(name: string): UsdNode | undefined;
|
|
30
40
|
numberOfNodes(): number;
|
|
31
41
|
getType(): SpecType;
|
|
32
42
|
getFullPathName(): string;
|
|
@@ -42,14 +52,15 @@ export declare class UsdNode {
|
|
|
42
52
|
flatten(arg: UsdNodeSerializeArgs): void;
|
|
43
53
|
setBoolean(name: string, value?: boolean): void;
|
|
44
54
|
setInt(name: string, value?: number): void;
|
|
45
|
-
setIntArray(name: string, value?: number
|
|
55
|
+
setIntArray(name: string, value?: ArrayLike<number>): void;
|
|
46
56
|
setFloat(name: string, value?: number): void;
|
|
47
57
|
setVec2f(name: string, value?: ArrayLike<number>): void;
|
|
48
58
|
setVec3f(name: string, value?: ArrayLike<number>): void;
|
|
59
|
+
setVec3fArray(name: string, value?: ArrayLike<number>): void;
|
|
49
60
|
setVec3d(name: string, value?: ArrayLike<number>): void;
|
|
50
61
|
setMatrix4d(name: string, value?: ArrayLike<number>): void;
|
|
51
62
|
setMatrix4dArray(name: string, value?: ArrayLike<number>): void;
|
|
52
|
-
setFloatArray(name: string, value?: number
|
|
63
|
+
setFloatArray(name: string, value?: ArrayLike<number>): void;
|
|
53
64
|
setDouble(name: string, value?: number): void;
|
|
54
65
|
setString(name: string, value?: string): void;
|
|
55
66
|
setSpecifier(name: string, value?: Specifier): void;
|
|
@@ -57,6 +68,7 @@ export declare class UsdNode {
|
|
|
57
68
|
setToken(name: string, value?: string): void;
|
|
58
69
|
setTokenArray(name: string, value?: string[]): void;
|
|
59
70
|
setTokenVector(name: string, value?: string[]): void;
|
|
71
|
+
setAssetPath(name: string, value?: string): void;
|
|
60
72
|
setPathListOp(name: string, value?: ListOp<UsdNode>): void;
|
|
61
73
|
setTokenListOp(name: string, value?: ListOp<string>): void;
|
|
62
74
|
setCustomData(name: string, value?: any): void;
|
|
@@ -1,8 +1,23 @@
|
|
|
1
|
-
import { isPrim, SpecType } from "
|
|
2
|
-
import { JUMP_NEXT_IS_CHILD_JUMP_TO_SIBLING, JUMP_NEXT_IS_CHILD_NO_SIBLINGS, JUMP_NO_CHILD_NEXT_IS_SIBLING, JUMP_NO_CHILD_NO_SIBLINGS } from "
|
|
1
|
+
import { isPrim, SpecType } from "../../crate/SpecType";
|
|
2
|
+
import { JUMP_NEXT_IS_CHILD_JUMP_TO_SIBLING, JUMP_NEXT_IS_CHILD_NO_SIBLINGS, JUMP_NO_CHILD_NEXT_IS_SIBLING, JUMP_NO_CHILD_NO_SIBLINGS } from "../../crate/Paths";
|
|
3
|
+
/**
|
|
4
|
+
* USD stores it's data in a tree of UsdNodes.
|
|
5
|
+
*
|
|
6
|
+
* - a node has fields encoded as ValueReps
|
|
7
|
+
* -
|
|
8
|
+
*/
|
|
3
9
|
export class UsdNode {
|
|
4
10
|
constructor(crate, parent, index, name, prim) {
|
|
5
11
|
this.children = [];
|
|
12
|
+
if (name.length === 0) {
|
|
13
|
+
throw Error(`UsdNode must not have an empty name`);
|
|
14
|
+
}
|
|
15
|
+
if (name != "/" && name.indexOf("/") >= 0) {
|
|
16
|
+
throw Error(`UsdNode '${name}' contains reserved character '/'`);
|
|
17
|
+
}
|
|
18
|
+
if (name.indexOf(".") >= 0) {
|
|
19
|
+
throw Error(`UsdNode '${name}' contains reserved character '.'`);
|
|
20
|
+
}
|
|
6
21
|
this.crate = crate;
|
|
7
22
|
this.parent = parent;
|
|
8
23
|
if (parent !== undefined) {
|
|
@@ -12,8 +27,13 @@ export class UsdNode {
|
|
|
12
27
|
this.name = name;
|
|
13
28
|
this.prim = prim;
|
|
14
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* encode node into the various sections of the crate
|
|
32
|
+
*/
|
|
15
33
|
encode() {
|
|
16
34
|
const crate = this.crate;
|
|
35
|
+
// this.index = crate.paths._nodes.length
|
|
36
|
+
// crate.paths._nodes.push(this)
|
|
17
37
|
crate.specs.pathIndexes.push(this.index);
|
|
18
38
|
crate.specs.specTypeIndexes.push(this.spec_type);
|
|
19
39
|
crate.specs.fieldsetIndexes.push(crate.fieldsets.fieldset_indices.length);
|
|
@@ -35,6 +55,14 @@ export class UsdNode {
|
|
|
35
55
|
}
|
|
36
56
|
}
|
|
37
57
|
}
|
|
58
|
+
findChild(name) {
|
|
59
|
+
for (let i = 0; i < this.children.length; ++i) {
|
|
60
|
+
if (this.children[i].name === name) {
|
|
61
|
+
return this.children[i];
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
38
66
|
numberOfNodes() {
|
|
39
67
|
let n = 1;
|
|
40
68
|
for (const child of this.children) {
|
|
@@ -119,7 +147,19 @@ export class UsdNode {
|
|
|
119
147
|
if (fields.size > 0) {
|
|
120
148
|
result.fields = {};
|
|
121
149
|
for (const [key, value] of fields) {
|
|
150
|
+
// const v = value.getValue(this.crate)
|
|
151
|
+
// if (v === undefined) {
|
|
152
|
+
// console.log(`ValueRep.getValue(): for ${this.getFullPathName()}.${key} not implemented yet: type: ${CrateDataType[value.getType()]}, array: ${value.isArray()}, inline: ${value.isInlined()}, compressed: ${value.isCompressed()}`)
|
|
153
|
+
// // console.log(value.toString())
|
|
154
|
+
// }
|
|
122
155
|
result.fields[key] = value.toJSON(this, key);
|
|
156
|
+
// {
|
|
157
|
+
// type: CrateDataType[value.getType()!],
|
|
158
|
+
// inline: value.isInlined(),
|
|
159
|
+
// array: value.isArray(),
|
|
160
|
+
// compressed: value.isCompressed(),
|
|
161
|
+
// value: v
|
|
162
|
+
// }
|
|
123
163
|
}
|
|
124
164
|
}
|
|
125
165
|
if (this.children.length > 0) {
|
|
@@ -148,6 +188,8 @@ export class UsdNode {
|
|
|
148
188
|
jump = JUMP_NO_CHILD_NEXT_IS_SIBLING;
|
|
149
189
|
}
|
|
150
190
|
if (hasChild && hasSibling) {
|
|
191
|
+
// jump needs to be the position of the next sibling
|
|
192
|
+
// jump = this.children.length + 1 // FIXME: my children and childrens children
|
|
151
193
|
jump = JUMP_NEXT_IS_CHILD_JUMP_TO_SIBLING;
|
|
152
194
|
}
|
|
153
195
|
arg.pathIndexes[arg.thisIndex] = arg.thisIndex;
|
|
@@ -157,6 +199,7 @@ export class UsdNode {
|
|
|
157
199
|
}
|
|
158
200
|
arg.tokenIndexes[arg.thisIndex] = tokenIndex;
|
|
159
201
|
arg.jumps[arg.thisIndex] = jump;
|
|
202
|
+
// console.log(`[${arg.thisIndex}] := ${" ".repeat(arg.depth)}${this.name}: hasChild = ${hasChild}, hasSibling=${hasSibling}, jump=${jumpName}`)
|
|
160
203
|
for (const child of this.children) {
|
|
161
204
|
++arg.thisIndex;
|
|
162
205
|
++arg.depth;
|
|
@@ -165,6 +208,7 @@ export class UsdNode {
|
|
|
165
208
|
}
|
|
166
209
|
if (jump === JUMP_NEXT_IS_CHILD_JUMP_TO_SIBLING) {
|
|
167
210
|
arg.jumps[thisIndex] = arg.thisIndex - thisIndex + 1;
|
|
211
|
+
// console.log(`jump[${thisIndex}] to ${arg.thisIndex + 1} by ${arg.thisIndex - thisIndex + 1}`)
|
|
168
212
|
}
|
|
169
213
|
}
|
|
170
214
|
setBoolean(name, value) {
|
|
@@ -197,6 +241,11 @@ export class UsdNode {
|
|
|
197
241
|
this.crate.fieldsets.fieldset_indices.push(this.crate.fields.setVec3f(name, value));
|
|
198
242
|
}
|
|
199
243
|
}
|
|
244
|
+
setVec3fArray(name, value) {
|
|
245
|
+
if (value !== undefined) {
|
|
246
|
+
this.crate.fieldsets.fieldset_indices.push(this.crate.fields.setVec3fArray(name, value));
|
|
247
|
+
}
|
|
248
|
+
}
|
|
200
249
|
setVec3d(name, value) {
|
|
201
250
|
if (value !== undefined) {
|
|
202
251
|
this.crate.fieldsets.fieldset_indices.push(this.crate.fields.setVec3d(name, value));
|
|
@@ -252,6 +301,11 @@ export class UsdNode {
|
|
|
252
301
|
this.crate.fieldsets.fieldset_indices.push(this.crate.fields.setTokenVector(name, value));
|
|
253
302
|
}
|
|
254
303
|
}
|
|
304
|
+
setAssetPath(name, value) {
|
|
305
|
+
if (value) {
|
|
306
|
+
this.crate.fieldsets.fieldset_indices.push(this.crate.fields.setAssetPath(name, value));
|
|
307
|
+
}
|
|
308
|
+
}
|
|
255
309
|
setPathListOp(name, value) {
|
|
256
310
|
if (value) {
|
|
257
311
|
this.crate.fieldsets.fieldset_indices.push(this.crate.fields.setPathListOp(name, value));
|