@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
|
@@ -1,7 +1,37 @@
|
|
|
1
1
|
import { Variability } from "../../crate/Variability";
|
|
2
2
|
import { BooleanAttr } from "../attributes/BooleanAttr";
|
|
3
3
|
import { Boundable } from "./Boundable";
|
|
4
|
+
/**
|
|
5
|
+
* Base class for all geometric primitives.
|
|
6
|
+
*
|
|
7
|
+
* Gprim encodes basic graphical properties such as _doubleSided_ and
|
|
8
|
+
* _orientation_, and provides primvars for "display color" and "display
|
|
9
|
+
* opacity" that travel with geometry to be used as shader overrides.
|
|
10
|
+
*
|
|
11
|
+
* defined in pxr/usd/usdGeom/schema.usda
|
|
12
|
+
*/
|
|
4
13
|
export class Gprim extends Boundable {
|
|
14
|
+
// color3f[] primvars:displayColor
|
|
15
|
+
// float[] primvars:displayOpacity
|
|
16
|
+
/**
|
|
17
|
+
* Although some renderers treat all parametric or polygonal
|
|
18
|
+
* surfaces as if they were effectively laminae with outward-facing
|
|
19
|
+
* normals on both sides, some renderers derive significant optimizations
|
|
20
|
+
* by considering these surfaces to have only a single outward side,
|
|
21
|
+
* typically determined by control-point winding order and/or
|
|
22
|
+
* \\em orientation. By doing so they can perform "backface culling" to
|
|
23
|
+
* avoid drawing the many polygons of most closed surfaces that face away
|
|
24
|
+
* from the viewer.
|
|
25
|
+
*
|
|
26
|
+
* However, it is often advantageous to model thin objects such as paper
|
|
27
|
+
* and cloth as single, open surfaces that must be viewable from both
|
|
28
|
+
* sides, always. Setting a gprim's \\em doubleSided attribute to
|
|
29
|
+
* \\c true instructs all renderers to disable optimizations such as
|
|
30
|
+
* backface culling for the gprim, and attempt (not all renderers are able
|
|
31
|
+
* to do so, but the USD reference GL renderer always will) to provide
|
|
32
|
+
* forward-facing normals on each side of the surface for lighting
|
|
33
|
+
* calculations.
|
|
34
|
+
*/
|
|
5
35
|
set doubleSided(value) {
|
|
6
36
|
this.deleteChild("doubleSided");
|
|
7
37
|
if (value !== undefined) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Gprim.js","sourceRoot":"","sources":["../../../src/nodes/geometry/Gprim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"Gprim.js","sourceRoot":"","sources":["../../../src/nodes/geometry/Gprim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC;;;;;;;;GAQG;AACH,MAAM,OAAO,KAAM,SAAQ,SAAS;IAChC,kCAAkC;IAClC,kCAAkC;IAElC;;;;;;;;;;;;;;;;;;OAkBG;IACH,IAAI,WAAW,CAAC,KAA0B;QACtC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,CAAA;QAC/B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACtB,IAAI,WAAW,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,EAAC,WAAW,EAAE,WAAW,CAAC,OAAO,EAAC,CAAC,CAAA;QACnF,CAAC;IACL,CAAC;CACJ"}
|
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
import { Typed } from "../usd/Typed";
|
|
2
|
+
/**
|
|
3
|
+
* Base class for all prims that may require rendering or
|
|
4
|
+
* visualization of some sort. The primary attributes of Imageable
|
|
5
|
+
* are _visibility_ and _purpose_, which each provide instructions for
|
|
6
|
+
* what geometry should be included for processing by rendering and other
|
|
7
|
+
* computations.
|
|
8
|
+
*
|
|
9
|
+
* defined in pxr/usd/usdGeom/schema.usda
|
|
10
|
+
*/
|
|
2
11
|
export declare class Imageable extends Typed {
|
|
3
12
|
}
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { Typed } from "../usd/Typed";
|
|
2
|
+
/**
|
|
3
|
+
* Base class for all prims that may require rendering or
|
|
4
|
+
* visualization of some sort. The primary attributes of Imageable
|
|
5
|
+
* are _visibility_ and _purpose_, which each provide instructions for
|
|
6
|
+
* what geometry should be included for processing by rendering and other
|
|
7
|
+
* computations.
|
|
8
|
+
*
|
|
9
|
+
* defined in pxr/usd/usdGeom/schema.usda
|
|
10
|
+
*/
|
|
2
11
|
export class Imageable extends Typed {
|
|
3
12
|
}
|
|
4
13
|
//# sourceMappingURL=Imageable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Imageable.js","sourceRoot":"","sources":["../../../src/nodes/geometry/Imageable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"Imageable.js","sourceRoot":"","sources":["../../../src/nodes/geometry/Imageable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAEpC;;;;;;;;GAQG;AACH,MAAM,OAAO,SAAU,SAAQ,KAAK;CAAI"}
|
|
@@ -1,25 +1,90 @@
|
|
|
1
|
-
import type { ListOp } from "../../crate/
|
|
2
|
-
import type { UsdNode } from "
|
|
3
|
-
import
|
|
4
|
-
import { PointBased } from "./PointBased";
|
|
5
|
-
|
|
1
|
+
import type { ListOp } from "../../crate/ListOp";
|
|
2
|
+
import type { UsdNode } from "../usd/UsdNode";
|
|
3
|
+
import { Skeleton } from "../skeleton/Skeleton";
|
|
4
|
+
import { PointBased, SubdivisionScheme } from "./PointBased";
|
|
5
|
+
import { SkelBindingAPI } from "./SkelBindingAPI";
|
|
6
|
+
import { BlendShape } from "../skeleton/BlendShape";
|
|
7
|
+
/**
|
|
8
|
+
* Encodes a mesh with optional subdivision properties and features.
|
|
9
|
+
*
|
|
10
|
+
* As a point-based primitive, meshes are defined in terms of points that
|
|
11
|
+
* are connected into edges and faces. Many references to meshes use the
|
|
12
|
+
* term 'vertex' in place of or interchangeably with 'points', while some
|
|
13
|
+
* use 'vertex' to refer to the 'face-vertices' that define a face. To
|
|
14
|
+
* avoid confusion, the term 'vertex' is intentionally avoided in favor of
|
|
15
|
+
* 'points' or 'face-vertices'.
|
|
16
|
+
*
|
|
17
|
+
* The connectivity between points, edges and faces is encoded using a
|
|
18
|
+
* common minimal topological description of the faces of the mesh. Each
|
|
19
|
+
* face is defined by a set of face-vertices using indices into the Mesh's
|
|
20
|
+
* _points_ array (inherited from UsdGeomPointBased) and laid out in a
|
|
21
|
+
* single linear _faceVertexIndices_ array for efficiency. A companion
|
|
22
|
+
* _faceVertexCounts_ array provides, for each face, the number of
|
|
23
|
+
* consecutive face-vertices in _faceVertexIndices_ that define the face.
|
|
24
|
+
* No additional connectivity information is required or constructed, so
|
|
25
|
+
* no adjacency or neighborhood queries are available.
|
|
26
|
+
*
|
|
27
|
+
* A key property of this mesh schema is that it encodes both subdivision
|
|
28
|
+
* surfaces and simpler polygonal meshes. This is achieved by varying the
|
|
29
|
+
* _subdivisionScheme_ attribute, which is set to specify Catmull-Clark
|
|
30
|
+
* subdivision by default, so polygonal meshes must always be explicitly
|
|
31
|
+
*declared. The available subdivision schemes and additional subdivision
|
|
32
|
+
* features encoded in optional attributes conform to the feature set of
|
|
33
|
+
* [OpenSubdiv](https://graphics.pixar.com/opensubdiv/docs/subdivision_surfaces.html).
|
|
34
|
+
*/
|
|
35
|
+
export declare class Mesh extends PointBased implements SkelBindingAPI {
|
|
6
36
|
constructor(parent: UsdNode, name: string);
|
|
7
37
|
encodeFields(): void;
|
|
8
38
|
private apiSchemas?;
|
|
9
|
-
|
|
39
|
+
private prependApiSchema;
|
|
10
40
|
set blenderDataName(value: string | undefined);
|
|
41
|
+
/**
|
|
42
|
+
* Flat list of the index (into the _points_ attribute) of each
|
|
43
|
+
* vertex of each face in the mesh. If this attribute has more than
|
|
44
|
+
* one timeSample, the mesh is considered to be topologically varying.
|
|
45
|
+
*/
|
|
11
46
|
set faceVertexIndices(value: ArrayLike<number> | undefined);
|
|
47
|
+
/**
|
|
48
|
+
* Provides the number of vertices in each face of the mesh,
|
|
49
|
+
* which is also the number of consecutive indices in _faceVertexIndices_
|
|
50
|
+
* that define the face. The length of this attribute is the number of
|
|
51
|
+
* faces in the mesh. If this attribute has more than
|
|
52
|
+
* one timeSample, the mesh is considered to be topologically varying.
|
|
53
|
+
*/
|
|
12
54
|
set faceVertexCounts(value: ArrayLike<number> | undefined);
|
|
55
|
+
/**
|
|
56
|
+
* The subdivision scheme to be applied to the surface.
|
|
57
|
+
* Valid values are:
|
|
58
|
+
*
|
|
59
|
+
* - __catmullClark__: The default, Catmull-Clark subdivision; preferred
|
|
60
|
+
* for quad-dominant meshes (generalizes B-splines); interpolation
|
|
61
|
+
* of point data is smooth (non-linear)
|
|
62
|
+
* - __loop__: Loop subdivision; preferred for purely triangular meshes;
|
|
63
|
+
* interpolation of point data is smooth (non-linear)
|
|
64
|
+
* - __bilinear__: Subdivision reduces all faces to quads (topologically
|
|
65
|
+
* similar to "catmullClark"); interpolation of point data is bilinear
|
|
66
|
+
* - __none__: No subdivision, i.e. a simple polygonal mesh; interpolation
|
|
67
|
+
* of point data is linear
|
|
68
|
+
*
|
|
69
|
+
* Polygonal meshes are typically lighter weight and faster to render,
|
|
70
|
+
* depending on renderer and render mode. Use of "bilinear" will produce
|
|
71
|
+
* a similar shape to a polygonal mesh and may offer additional guarantees
|
|
72
|
+
* of watertightness and additional subdivision features (e.g. holes) but
|
|
73
|
+
* may also not respect authored normals.
|
|
74
|
+
*/
|
|
75
|
+
set subdivisionScheme(value: SubdivisionScheme | undefined);
|
|
13
76
|
set materialBinding(value: ListOp<UsdNode> | undefined);
|
|
14
77
|
set familyType(value: "partition" | "nonOverlapping" | "unrestricted" | undefined);
|
|
15
|
-
set
|
|
78
|
+
set skeleton(value: Skeleton | ListOp<Skeleton> | undefined);
|
|
79
|
+
set geomBindTransform(value: ArrayLike<number> | undefined);
|
|
16
80
|
set jointIndices(value: {
|
|
17
81
|
elementSize: number;
|
|
18
|
-
indices: number
|
|
82
|
+
indices: ArrayLike<number>;
|
|
19
83
|
} | undefined);
|
|
20
84
|
set jointWeights(value: {
|
|
21
85
|
elementSize: number;
|
|
22
|
-
indices: number
|
|
86
|
+
indices: ArrayLike<number>;
|
|
23
87
|
} | undefined);
|
|
24
|
-
set
|
|
88
|
+
set blendShapes(value: string[] | undefined);
|
|
89
|
+
set blendShapeTargets(value: BlendShape[] | undefined);
|
|
25
90
|
}
|
|
@@ -6,7 +6,37 @@ import { IntArrayAttr } from "../attributes/IntArrayAttr";
|
|
|
6
6
|
import { VariabilityAttr } from "../attributes/VariabilityAttr";
|
|
7
7
|
import { Relationship } from "../attributes/Relationship";
|
|
8
8
|
import { StringAttr } from "../attributes/StringAttr";
|
|
9
|
+
import { Skeleton } from "../skeleton/Skeleton";
|
|
9
10
|
import { PointBased } from "./PointBased";
|
|
11
|
+
import { TokenAttr } from "../attributes/TokenAttr";
|
|
12
|
+
/**
|
|
13
|
+
* Encodes a mesh with optional subdivision properties and features.
|
|
14
|
+
*
|
|
15
|
+
* As a point-based primitive, meshes are defined in terms of points that
|
|
16
|
+
* are connected into edges and faces. Many references to meshes use the
|
|
17
|
+
* term 'vertex' in place of or interchangeably with 'points', while some
|
|
18
|
+
* use 'vertex' to refer to the 'face-vertices' that define a face. To
|
|
19
|
+
* avoid confusion, the term 'vertex' is intentionally avoided in favor of
|
|
20
|
+
* 'points' or 'face-vertices'.
|
|
21
|
+
*
|
|
22
|
+
* The connectivity between points, edges and faces is encoded using a
|
|
23
|
+
* common minimal topological description of the faces of the mesh. Each
|
|
24
|
+
* face is defined by a set of face-vertices using indices into the Mesh's
|
|
25
|
+
* _points_ array (inherited from UsdGeomPointBased) and laid out in a
|
|
26
|
+
* single linear _faceVertexIndices_ array for efficiency. A companion
|
|
27
|
+
* _faceVertexCounts_ array provides, for each face, the number of
|
|
28
|
+
* consecutive face-vertices in _faceVertexIndices_ that define the face.
|
|
29
|
+
* No additional connectivity information is required or constructed, so
|
|
30
|
+
* no adjacency or neighborhood queries are available.
|
|
31
|
+
*
|
|
32
|
+
* A key property of this mesh schema is that it encodes both subdivision
|
|
33
|
+
* surfaces and simpler polygonal meshes. This is achieved by varying the
|
|
34
|
+
* _subdivisionScheme_ attribute, which is set to specify Catmull-Clark
|
|
35
|
+
* subdivision by default, so polygonal meshes must always be explicitly
|
|
36
|
+
*declared. The available subdivision schemes and additional subdivision
|
|
37
|
+
* features encoded in optional attributes conform to the feature set of
|
|
38
|
+
* [OpenSubdiv](https://graphics.pixar.com/opensubdiv/docs/subdivision_surfaces.html).
|
|
39
|
+
*/
|
|
10
40
|
export class Mesh extends PointBased {
|
|
11
41
|
constructor(parent, name) {
|
|
12
42
|
super(parent.crate, parent, -1, name, true);
|
|
@@ -30,37 +60,115 @@ export class Mesh extends PointBased {
|
|
|
30
60
|
this.apiSchemas.prepend.push(name);
|
|
31
61
|
}
|
|
32
62
|
}
|
|
63
|
+
// also in Material
|
|
33
64
|
set blenderDataName(value) {
|
|
34
65
|
this.deleteChild("userProperties:blender:data_name");
|
|
35
66
|
if (value !== undefined) {
|
|
36
67
|
new StringAttr(this, "userProperties:blender:data_name", value, { custom: true });
|
|
37
68
|
}
|
|
38
69
|
}
|
|
70
|
+
//
|
|
71
|
+
// Common Properties
|
|
72
|
+
//
|
|
73
|
+
/**
|
|
74
|
+
* Flat list of the index (into the _points_ attribute) of each
|
|
75
|
+
* vertex of each face in the mesh. If this attribute has more than
|
|
76
|
+
* one timeSample, the mesh is considered to be topologically varying.
|
|
77
|
+
*/
|
|
39
78
|
set faceVertexIndices(value) {
|
|
40
79
|
this.deleteChild("faceVertexIndices");
|
|
41
80
|
if (value !== undefined) {
|
|
42
81
|
new IntArrayAttr(this, "faceVertexIndices", value);
|
|
43
82
|
}
|
|
44
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Provides the number of vertices in each face of the mesh,
|
|
86
|
+
* which is also the number of consecutive indices in _faceVertexIndices_
|
|
87
|
+
* that define the face. The length of this attribute is the number of
|
|
88
|
+
* faces in the mesh. If this attribute has more than
|
|
89
|
+
* one timeSample, the mesh is considered to be topologically varying.
|
|
90
|
+
*/
|
|
45
91
|
set faceVertexCounts(value) {
|
|
46
92
|
this.deleteChild("faceVertexCounts");
|
|
47
93
|
if (value !== undefined) {
|
|
48
94
|
new IntArrayAttr(this, "faceVertexCounts", value);
|
|
49
95
|
}
|
|
50
96
|
}
|
|
97
|
+
//
|
|
98
|
+
// Subdiv Properties
|
|
99
|
+
//
|
|
100
|
+
/**
|
|
101
|
+
* The subdivision scheme to be applied to the surface.
|
|
102
|
+
* Valid values are:
|
|
103
|
+
*
|
|
104
|
+
* - __catmullClark__: The default, Catmull-Clark subdivision; preferred
|
|
105
|
+
* for quad-dominant meshes (generalizes B-splines); interpolation
|
|
106
|
+
* of point data is smooth (non-linear)
|
|
107
|
+
* - __loop__: Loop subdivision; preferred for purely triangular meshes;
|
|
108
|
+
* interpolation of point data is smooth (non-linear)
|
|
109
|
+
* - __bilinear__: Subdivision reduces all faces to quads (topologically
|
|
110
|
+
* similar to "catmullClark"); interpolation of point data is bilinear
|
|
111
|
+
* - __none__: No subdivision, i.e. a simple polygonal mesh; interpolation
|
|
112
|
+
* of point data is linear
|
|
113
|
+
*
|
|
114
|
+
* Polygonal meshes are typically lighter weight and faster to render,
|
|
115
|
+
* depending on renderer and render mode. Use of "bilinear" will produce
|
|
116
|
+
* a similar shape to a polygonal mesh and may offer additional guarantees
|
|
117
|
+
* of watertightness and additional subdivision features (e.g. holes) but
|
|
118
|
+
* may also not respect authored normals.
|
|
119
|
+
*/
|
|
120
|
+
set subdivisionScheme(value) {
|
|
121
|
+
this.deleteChild("subdivisionScheme");
|
|
122
|
+
if (value !== undefined) {
|
|
123
|
+
new VariabilityAttr(this, "subdivisionScheme", Variability.Uniform, value);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
// interpolateBoundary
|
|
127
|
+
// faceVaryingLinearInterpolation
|
|
128
|
+
// triangleSubdivisionRule
|
|
129
|
+
// holeIndices
|
|
130
|
+
// cornerIndices
|
|
131
|
+
// cornerSharpnesses
|
|
132
|
+
// creaseIndices
|
|
133
|
+
// creaseLengths
|
|
134
|
+
// creaseSharpnesses
|
|
135
|
+
// MaterialBindingAPI: material:binding
|
|
136
|
+
// pxr/usd/usdShade/schema.usda
|
|
51
137
|
set materialBinding(value) {
|
|
52
138
|
this.deleteChild("material:binding");
|
|
53
|
-
if (value
|
|
54
|
-
|
|
55
|
-
new Relationship(this, "material:binding", value);
|
|
139
|
+
if (value === undefined) {
|
|
140
|
+
return;
|
|
56
141
|
}
|
|
142
|
+
this.prependApiSchema("MaterialBindingAPI");
|
|
143
|
+
new Relationship(this, "material:binding", value);
|
|
57
144
|
}
|
|
145
|
+
//
|
|
146
|
+
// GeomSubset
|
|
147
|
+
//
|
|
58
148
|
set familyType(value) {
|
|
59
149
|
this.deleteChild("subsetFamily:materialBind:familyType");
|
|
60
150
|
if (value !== undefined) {
|
|
61
151
|
new VariabilityAttr(this, "subsetFamily:materialBind:familyType", Variability.Uniform, value);
|
|
62
152
|
}
|
|
63
153
|
}
|
|
154
|
+
//
|
|
155
|
+
// SkelBindingAPI
|
|
156
|
+
//
|
|
157
|
+
set skeleton(value) {
|
|
158
|
+
this.deleteChild("skel:skeleton");
|
|
159
|
+
if (value === undefined) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
this.prependApiSchema("SkelBindingAPI");
|
|
163
|
+
if (value instanceof Skeleton) {
|
|
164
|
+
new Relationship(this, "skel:skeleton", {
|
|
165
|
+
isExplicit: true,
|
|
166
|
+
explicit: [value]
|
|
167
|
+
});
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
new Relationship(this, "skel:skeleton", value);
|
|
171
|
+
}
|
|
64
172
|
set geomBindTransform(value) {
|
|
65
173
|
this.deleteChild("primvars:skel:geomBindTransform");
|
|
66
174
|
if (value !== undefined) {
|
|
@@ -95,13 +203,18 @@ export class Mesh extends PointBased {
|
|
|
95
203
|
});
|
|
96
204
|
}
|
|
97
205
|
}
|
|
98
|
-
set
|
|
99
|
-
this.deleteChild("skel:
|
|
206
|
+
set blendShapes(value) {
|
|
207
|
+
this.deleteChild("skel:blendShapes");
|
|
100
208
|
if (value !== undefined) {
|
|
101
|
-
this
|
|
102
|
-
|
|
209
|
+
new TokenAttr(this, "skel:blendShapes", Variability.Uniform, value);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
set blendShapeTargets(value) {
|
|
213
|
+
this.deleteChild("skel:blendShapeTargets");
|
|
214
|
+
if (value !== undefined) {
|
|
215
|
+
new Relationship(this, "skel:blendShapeTargets", {
|
|
103
216
|
isExplicit: true,
|
|
104
|
-
explicit:
|
|
217
|
+
explicit: value
|
|
105
218
|
});
|
|
106
219
|
}
|
|
107
220
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Mesh.js","sourceRoot":"","sources":["../../../src/nodes/geometry/Mesh.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"Mesh.js","sourceRoot":"","sources":["../../../src/nodes/geometry/Mesh.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO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IAAI,SAAS,CAAC,IAAI,EAAE,4BAA4B,EAAE,IAAI,CAAC,EAAE;gBACrD,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC,CAAA;gBACpC,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAA;gBACxC,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,KAAK,CAAC,WAAW,CAAC,CAAA;gBAC7C,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;YAChD,CAAC,CAAC,CAAA;QACN,CAAC;IACL,CAAC;IAED,IAAI,WAAW,CAAC,KAA2B;QACvC,IAAI,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAA;QACpC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACtB,IAAI,SAAS,CAAC,IAAI,EAAE,kBAAkB,EAAE,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;QACvE,CAAC;IACL,CAAC;IAED,IAAI,iBAAiB,CAAC,KAA+B;QACjD,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAAC,CAAA;QAC1C,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACtB,IAAI,YAAY,CAAC,IAAI,EAAE,wBAAwB,EAAE;gBAC7C,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,KAAK;aAClB,CAAC,CAAA;QACN,CAAC;IACL,CAAC;CACJ"}
|
|
@@ -2,11 +2,29 @@ import { Gprim } from "./Gprim";
|
|
|
2
2
|
export type SubdivisionScheme = "catmullClark" | "loop" | "bilinear" | "none";
|
|
3
3
|
export type InterpolateBoundary = "none" | "edgeOnly" | "edgeAndCorner";
|
|
4
4
|
export type FaceVaryingLinearInterpolation = "none" | "cornersOnly" | "cornersPlus1" | "cornersPlus2" | "boundaries" | "all";
|
|
5
|
+
/**
|
|
6
|
+
* Base class for all UsdGeomGprims that possess points,
|
|
7
|
+
* providing common attributes such as normals and velocities.
|
|
8
|
+
*/
|
|
5
9
|
export declare class PointBased extends Gprim {
|
|
10
|
+
/**
|
|
11
|
+
* The primary geometry attribute for all PointBased
|
|
12
|
+
* primitives, describes points in (local) space.
|
|
13
|
+
*/
|
|
6
14
|
set points(value: ArrayLike<number> | undefined);
|
|
7
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Provide an object-space orientation for individual points,
|
|
17
|
+
* which, depending on subclass, may define a surface, curve, or free
|
|
18
|
+
* points. Note that 'normals' should not be authored on any Mesh that
|
|
19
|
+
* is subdivided, since the subdivision algorithm will define its own
|
|
20
|
+
* normals. 'normals' is not a generic primvar, but the number of elements
|
|
21
|
+
* in this attribute will be determined by its 'interpolation'. See
|
|
22
|
+
* \\ref SetNormalsInterpolation() . If 'normals' and 'primvars:normals'
|
|
23
|
+
* are both specified, the latter has precedence.
|
|
24
|
+
*/
|
|
8
25
|
set normals(value: ArrayLike<number> | undefined);
|
|
9
|
-
set
|
|
26
|
+
set texCoords(value: ArrayLike<number> | undefined);
|
|
27
|
+
set texIndices(value: ArrayLike<number> | undefined);
|
|
10
28
|
interpolateBoundary: InterpolateBoundary;
|
|
11
29
|
faceVaryingLinearInterpolation: FaceVaryingLinearInterpolation;
|
|
12
30
|
}
|
|
@@ -1,38 +1,62 @@
|
|
|
1
|
-
import { Variability } from "../../crate/Variability";
|
|
2
1
|
import { Vec2fArrayAttr } from "../attributes/Vec2fArrayAttr";
|
|
3
2
|
import { Vec3fArrayAttr } from "../attributes/Vec3fArrayAttr";
|
|
4
|
-
import { VariabilityAttr } from "../attributes/VariabilityAttr";
|
|
5
3
|
import { Gprim } from "./Gprim";
|
|
4
|
+
import { Attribute } from "../attributes/Attribute";
|
|
5
|
+
/**
|
|
6
|
+
* Base class for all UsdGeomGprims that possess points,
|
|
7
|
+
* providing common attributes such as normals and velocities.
|
|
8
|
+
*/
|
|
6
9
|
export class PointBased extends Gprim {
|
|
7
10
|
constructor() {
|
|
8
11
|
super(...arguments);
|
|
9
12
|
this.interpolateBoundary = "edgeAndCorner";
|
|
10
13
|
this.faceVaryingLinearInterpolation = "cornersPlus1";
|
|
11
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* The primary geometry attribute for all PointBased
|
|
17
|
+
* primitives, describes points in (local) space.
|
|
18
|
+
*/
|
|
12
19
|
set points(value) {
|
|
13
20
|
this.deleteChild("points");
|
|
14
21
|
if (value !== undefined) {
|
|
15
22
|
new Vec3fArrayAttr(this, "points", value, "point3f[]");
|
|
16
23
|
}
|
|
17
24
|
}
|
|
18
|
-
|
|
19
|
-
|
|
25
|
+
// vector3f[] velocities
|
|
26
|
+
// vector3f[] accelerations
|
|
27
|
+
/**
|
|
28
|
+
* Provide an object-space orientation for individual points,
|
|
29
|
+
* which, depending on subclass, may define a surface, curve, or free
|
|
30
|
+
* points. Note that 'normals' should not be authored on any Mesh that
|
|
31
|
+
* is subdivided, since the subdivision algorithm will define its own
|
|
32
|
+
* normals. 'normals' is not a generic primvar, but the number of elements
|
|
33
|
+
* in this attribute will be determined by its 'interpolation'. See
|
|
34
|
+
* \\ref SetNormalsInterpolation() . If 'normals' and 'primvars:normals'
|
|
35
|
+
* are both specified, the latter has precedence.
|
|
36
|
+
*/
|
|
37
|
+
set normals(value) {
|
|
38
|
+
this.deleteChild("normals");
|
|
20
39
|
if (value !== undefined) {
|
|
21
|
-
const attr = new
|
|
40
|
+
const attr = new Vec3fArrayAttr(this, "normals", value, "normal3f[]");
|
|
22
41
|
attr.interpolation = "faceVarying";
|
|
23
42
|
}
|
|
24
43
|
}
|
|
25
|
-
set
|
|
26
|
-
this.deleteChild("
|
|
44
|
+
set texCoords(value) {
|
|
45
|
+
this.deleteChild("primvars:st");
|
|
27
46
|
if (value !== undefined) {
|
|
28
|
-
const attr = new
|
|
47
|
+
const attr = new Vec2fArrayAttr(this.crate, this, "primvars:st", value, "texCoord2f[]");
|
|
29
48
|
attr.interpolation = "faceVarying";
|
|
30
49
|
}
|
|
31
50
|
}
|
|
32
|
-
set
|
|
33
|
-
this.deleteChild("
|
|
51
|
+
set texIndices(value) {
|
|
52
|
+
this.deleteChild("primvars:st:indices");
|
|
34
53
|
if (value !== undefined) {
|
|
35
|
-
new
|
|
54
|
+
new Attribute(this, "primvars:st:indices", (node) => {
|
|
55
|
+
node.setToken("typeName", "int[]");
|
|
56
|
+
node.setIntArray("default", value);
|
|
57
|
+
});
|
|
58
|
+
// const attr = new Vec2fArrayAttr(this.crate, this, "primvars:st:indices", value, "texCoord2f[]")
|
|
59
|
+
// attr.interpolation = "faceVarying"
|
|
36
60
|
}
|
|
37
61
|
}
|
|
38
62
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PointBased.js","sourceRoot":"","sources":["../../../src/nodes/geometry/PointBased.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PointBased.js","sourceRoot":"","sources":["../../../src/nodes/geometry/PointBased.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAE7D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAenD;;;GAGG;AACH,MAAM,OAAO,UAAW,SAAQ,KAAK;IAArC;;QAgDI,wBAAmB,GAAwB,eAAe,CAAC;QAC3D,mCAA8B,GAAmC,cAAc,CAAC;IACpF,CAAC;IAjDG;;;OAGG;IACH,IAAI,MAAM,CAAC,KAAoC;QAC3C,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;QAC1B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACtB,IAAI,cAAc,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,CAAC,CAAA;QAC1D,CAAC;IACL,CAAC;IACD,wBAAwB;IACxB,2BAA2B;IAC3B;;;;;;;;;OASG;IACH,IAAI,OAAO,CAAC,KAAoC;QAC5C,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAA;QAC3B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACtB,MAAM,IAAI,GAAG,IAAI,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,CAAC,CAAA;YACrE,IAAI,CAAC,aAAa,GAAG,aAAa,CAAA;QACtC,CAAC;IACL,CAAC;IACD,IAAI,SAAS,CAAC,KAAoC;QAC9C,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,CAAA;QAC/B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACtB,MAAM,IAAI,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,cAAc,CAAC,CAAA;YACvF,IAAI,CAAC,aAAa,GAAG,aAAa,CAAA;QACtC,CAAC;IACL,CAAC;IACD,IAAI,UAAU,CAAC,KAAoC;QAC/C,IAAI,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAA;QACvC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACtB,IAAI,SAAS,CAAC,IAAI,EAAE,qBAAqB,EAAE,CAAC,IAAI,EAAE,EAAE;gBAChD,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;gBAClC,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;YACtC,CAAC,CAAC,CAAA;YACF,kGAAkG;YAClG,qCAAqC;QACzC,CAAC;IACL,CAAC;CAGJ"}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
import type { UsdNode } from "
|
|
1
|
+
import type { UsdNode } from "../usd/UsdNode";
|
|
2
2
|
import { Imageable } from "./Imageable";
|
|
3
|
+
/**
|
|
4
|
+
* Scope is the simplest grouping primitive, and does not carry the
|
|
5
|
+
* baggage of transformability. Note that transforms should inherit down
|
|
6
|
+
* through a Scope successfully - it is just a guaranteed no-op from a
|
|
7
|
+
* transformability perspective.
|
|
8
|
+
*
|
|
9
|
+
* defined in pxr/usd/usdGeom/schema.usda
|
|
10
|
+
*/
|
|
3
11
|
export declare class Scope extends Imageable {
|
|
4
12
|
constructor(parent: UsdNode, name: string);
|
|
5
13
|
}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { Specifier } from "../../crate/Specifier";
|
|
2
2
|
import { SpecType } from "../../crate/SpecType";
|
|
3
3
|
import { Imageable } from "./Imageable";
|
|
4
|
+
/**
|
|
5
|
+
* Scope is the simplest grouping primitive, and does not carry the
|
|
6
|
+
* baggage of transformability. Note that transforms should inherit down
|
|
7
|
+
* through a Scope successfully - it is just a guaranteed no-op from a
|
|
8
|
+
* transformability perspective.
|
|
9
|
+
*
|
|
10
|
+
* defined in pxr/usd/usdGeom/schema.usda
|
|
11
|
+
*/
|
|
4
12
|
export class Scope extends Imageable {
|
|
5
13
|
constructor(parent, name) {
|
|
6
14
|
super(parent.crate, parent, -1, name, true);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Scope.js","sourceRoot":"","sources":["../../../src/nodes/geometry/Scope.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,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"Scope.js","sourceRoot":"","sources":["../../../src/nodes/geometry/Scope.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,aAAa,CAAA;AAEvC;;;;;;;GAOG;AACH,MAAM,OAAO,KAAM,SAAQ,SAAS;IAChC,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,OAAO,CAAA;IAC3B,CAAC;CACJ"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { ListOp } from "../../crate/ListOp";
|
|
2
|
+
import { BlendShape } from "../skeleton/BlendShape";
|
|
3
|
+
import type { Skeleton } from "../skeleton/Skeleton";
|
|
4
|
+
/**
|
|
5
|
+
* Provides API for authoring and extracting all the skinning-related
|
|
6
|
+
* data that lives in the "geometry hierarchy" of prims and models that want
|
|
7
|
+
* to be skeletally deformed.
|
|
8
|
+
*/
|
|
9
|
+
export interface SkelBindingAPI {
|
|
10
|
+
/**
|
|
11
|
+
* Skeleton to be bound to this prim and its descendents that
|
|
12
|
+
* possess a mapping and weighting to the joints of the identified
|
|
13
|
+
* Skeleton.
|
|
14
|
+
*/
|
|
15
|
+
set skeleton(value: Skeleton | ListOp<Skeleton> | undefined);
|
|
16
|
+
/**
|
|
17
|
+
* Encodes the bind-time world space transforms of the prim.
|
|
18
|
+
* If the transform is identical for a group of gprims that share a common
|
|
19
|
+
* ancestor, the transform may be authored on the ancestor, to "inherit"
|
|
20
|
+
* down to all the leaf gprims. If this transform is unset, an identity
|
|
21
|
+
* transform is used instead.
|
|
22
|
+
*/
|
|
23
|
+
set geomBindTransform(value: ArrayLike<number> | undefined);
|
|
24
|
+
/**
|
|
25
|
+
* Indices into the *joints* attribute of the closest (in namespace) bound Skeleton
|
|
26
|
+
* that affect each point of a PointBased gprim.
|
|
27
|
+
*
|
|
28
|
+
* The primvar can have either *constant* or *vertex* interpolation.
|
|
29
|
+
*
|
|
30
|
+
* This primvar's *elementSize* will determine how many joint influences
|
|
31
|
+
* apply to each point. Indices must point be valid. Null influences should
|
|
32
|
+
* be defined by setting values in jointWeights to zero.
|
|
33
|
+
*
|
|
34
|
+
* [ point0 -> (joint_0, ..., joint_elementSize), ...]
|
|
35
|
+
*/
|
|
36
|
+
set jointIndices(value: {
|
|
37
|
+
elementSize: number;
|
|
38
|
+
indices: ArrayLike<number>;
|
|
39
|
+
} | undefined);
|
|
40
|
+
/**
|
|
41
|
+
* Weights for the joints that affect each point of a PointBased
|
|
42
|
+
* gprim.
|
|
43
|
+
*
|
|
44
|
+
* The primvar can have either *constant* or *vertex* interpolation.
|
|
45
|
+
* This primvar's *elementSize* will determine how many joints influences
|
|
46
|
+
* apply to each point.
|
|
47
|
+
*
|
|
48
|
+
* The length, interpolation, and elementSize of *jointWeights* must match
|
|
49
|
+
* that of *jointIndices*.
|
|
50
|
+
*/
|
|
51
|
+
set jointWeights(value: {
|
|
52
|
+
elementSize: number;
|
|
53
|
+
indices: ArrayLike<number>;
|
|
54
|
+
} | undefined);
|
|
55
|
+
/**
|
|
56
|
+
* An array of tokens defining the order onto which blend shape
|
|
57
|
+
* weights from an animation source map onto the *skel:blendShapeTargets*
|
|
58
|
+
* rel of a binding site. If authored, the number of elements must be equal
|
|
59
|
+
* to the number of targets in the _blendShapeTargets_ rel. This property
|
|
60
|
+
* is not inherited hierarchically, and is expected to be authored directly
|
|
61
|
+
* on the skinnable primitive to which the blend shapes apply.
|
|
62
|
+
*/
|
|
63
|
+
set blendShapes(value: string[] | undefined);
|
|
64
|
+
/**
|
|
65
|
+
* Ordered list of all target blend shapes. This property is not
|
|
66
|
+
* inherited hierarchically, and is expected to be authored directly on
|
|
67
|
+
* the skinnable primitive to which the the blend shapes apply.
|
|
68
|
+
*/
|
|
69
|
+
set blendShapeTargets(value: BlendShape[] | undefined);
|
|
70
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SkelBindingAPI.js","sourceRoot":"","sources":["../../../src/nodes/geometry/SkelBindingAPI.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import type { UsdNode } from "
|
|
1
|
+
import type { UsdNode } from "../usd/UsdNode";
|
|
2
2
|
import { Xformable } from "./Xformable";
|
|
3
|
+
/**
|
|
4
|
+
* Concrete prim schema for a transform, which implements Xformable
|
|
5
|
+
*
|
|
6
|
+
* defined in pxr/usd/usdGeom/schema.usda
|
|
7
|
+
*/
|
|
3
8
|
export declare class Xform extends Xformable {
|
|
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 { Xformable } from "./Xformable";
|
|
4
|
+
/**
|
|
5
|
+
* Concrete prim schema for a transform, which implements Xformable
|
|
6
|
+
*
|
|
7
|
+
* defined in pxr/usd/usdGeom/schema.usda
|
|
8
|
+
*/
|
|
4
9
|
export class Xform extends Xformable {
|
|
5
10
|
constructor(parent, name) {
|
|
6
11
|
super(parent.crate, parent, -1, name, true);
|