Skip to content
This repository has been archived by the owner on Mar 25, 2020. It is now read-only.

Commit

Permalink
USD 0.7.5
Browse files Browse the repository at this point in the history
  • Loading branch information
i-saint committed May 3, 2017
1 parent 9874e7e commit f022eb4
Show file tree
Hide file tree
Showing 29 changed files with 402 additions and 302 deletions.
2 changes: 1 addition & 1 deletion Plugin/MeshUtils.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<ItemGroup>
<CustomBuild Include="MeshUtils\MeshUtilsCore.ispc">
<FileType>Document</FileType>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">External\ispc %(FullPath) -o $(IntDir)%(Filename).obj -h $(IntDir)%(Filename).h --target=sse2,sse4,avx --arch=x86-64 --opt=fast-masked-vload --opt=fast-math --opt=force-aligned-memory
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">External\ispc %(FullPath) -o $(IntDir)%(Filename).obj -h $(IntDir)%(Filename).h --target=sse2,sse4,avx --arch=x86-64 --opt=fast-masked-vload --opt=fast-math
copy $(IntDir)%(Filename).h %(RelativeDir)</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Master|x64'">External\ispc %(FullPath) -o $(IntDir)%(Filename).obj -h $(IntDir)%(Filename).h --target=sse2,sse4,avx --arch=x86-64 --opt=fast-masked-vload --opt=fast-math --opt=force-aligned-memory
copy $(IntDir)%(Filename).h %(RelativeDir)</Command>
Expand Down
2 changes: 1 addition & 1 deletion Plugin/usdi/etc/MonoWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ mProperty mObject::findProperty(const char *name) const
{
return getClass().findProperty(name);
}
mMethod mObject::findMethod(const char *name, int num_args, const char **typenames) const
mMethod mObject::findMethod(const char *name, int num_args, const char**) const
{
return getClass().findMethod(name, num_args);
}
Expand Down
2 changes: 1 addition & 1 deletion Plugin/usdi/ext/UnityEngineBinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void TransformAssignM(MonoObject *trans, XformData *data_)
}
}

void TransformNotfyChangeM(MonoObject *trans)
void TransformNotfyChangeM(MonoObject *)
{
// nothing to do
}
Expand Down
4 changes: 3 additions & 1 deletion Plugin/usdi/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@

#pragma warning(push)
#pragma warning(disable:4100 4127 4244 4305)
#include "pxr/usd/sdf/types.h"
#include "pxr/usd/usd/modelAPI.h"
#include "pxr/usd/usd/timeCode.h"
#include "pxr/usd/usd/treeIterator.h"
#include "pxr/usd/usd/variantSets.h"
#include "pxr/usd/usd/stage.h"
#include "pxr/usd/usdGeom/xform.h"
#include "pxr/usd/usdGeom/xformCommonAPI.h"
#include "pxr/usd/usdGeom/camera.h"
Expand All @@ -63,6 +64,7 @@
#include "pxr/base/gf/matrix4f.h"
#include "pxr/usd/ar/resolver.h"
#include "pxr/usd/sdf/fileFormat.h"
#include "half.h"
#pragma warning(pop)

#include "etc/Platform.h"
Expand Down
2 changes: 1 addition & 1 deletion Plugin/usdi/usdi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#pragma comment(lib, "Shlwapi.lib")
#pragma comment(lib, "Ws2_32.lib")
#pragma comment(lib, "half.lib")
#pragma comment(lib, "double-conversion.lib")

#pragma comment(lib, "ar.lib")
#pragma comment(lib, "arch.lib")
Expand All @@ -34,6 +33,7 @@
#pragma comment(lib, "libittnotify.lib")
#endif
#endif
PXR_NAMESPACE_USING_DIRECTIVE

namespace usdi {
extern int g_debug_level;
Expand Down
54 changes: 28 additions & 26 deletions Plugin/usdi/usdiAttribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ namespace usdi {
Body(uint, AttributeType::UInt, SdfValueTypeNames->UInt, TAttribute<uint>)\
Body(int64_t, AttributeType::Int64, SdfValueTypeNames->Int64, TAttribute<int64_t>)\
Body(uint64_t, AttributeType::UInt64, SdfValueTypeNames->UInt64, TAttribute<uint64_t>)\
Body(half, AttributeType::Half, SdfValueTypeNames->Half, TAttribute<half>)\
Body(GfVec2h, AttributeType::Half2, SdfValueTypeNames->Half2, TAttribute<GfVec2h>)\
Body(GfVec3h, AttributeType::Half3, SdfValueTypeNames->Half3, TAttribute<GfVec3h>)\
Body(GfVec4h, AttributeType::Half4, SdfValueTypeNames->Half4, TAttribute<GfVec4h>)\
Body(GfQuath, AttributeType::QuatH, SdfValueTypeNames->Quath, TAttribute<GfQuath>)\
Body(float, AttributeType::Float, SdfValueTypeNames->Float, TAttribute<float>)\
Body(GfVec2f, AttributeType::Float2, SdfValueTypeNames->Float2, TAttribute<GfVec2f>)\
Body(GfVec3f, AttributeType::Float3, SdfValueTypeNames->Float3, TAttribute<GfVec3f>)\
Expand All @@ -40,11 +35,6 @@ namespace usdi {
Body(VtArray<uint>, AttributeType::UIntArray, SdfValueTypeNames->UIntArray, TAttribute<VtArray<uint>>)\
Body(VtArray<int64_t>, AttributeType::Int64Array, SdfValueTypeNames->Int64Array, TAttribute<VtArray<int64_t>>)\
Body(VtArray<uint64_t>, AttributeType::UInt64Array, SdfValueTypeNames->UInt64Array, TAttribute<VtArray<uint64_t>>)\
Body(VtArray<half>, AttributeType::HalfArray, SdfValueTypeNames->HalfArray, TAttribute<VtArray<half>>)\
Body(VtArray<GfVec2h>, AttributeType::Half2Array, SdfValueTypeNames->Half2Array, TAttribute<VtArray<GfVec2h>>)\
Body(VtArray<GfVec3h>, AttributeType::Half3Array, SdfValueTypeNames->Half3Array, TAttribute<VtArray<GfVec3h>>)\
Body(VtArray<GfVec4h>, AttributeType::Half4Array, SdfValueTypeNames->Half4Array, TAttribute<VtArray<GfVec4h>>)\
Body(VtArray<GfQuath>, AttributeType::QuatHArray, SdfValueTypeNames->QuathArray, TAttribute<VtArray<GfQuath>>)\
Body(VtArray<float>, AttributeType::FloatArray, SdfValueTypeNames->FloatArray, TAttribute<VtArray<float>>)\
Body(VtArray<GfVec2f>, AttributeType::Float2Array, SdfValueTypeNames->Float2Array, TAttribute<VtArray<GfVec2f>>)\
Body(VtArray<GfVec3f>, AttributeType::Float3Array, SdfValueTypeNames->Float3Array, TAttribute<VtArray<GfVec3f>>)\
Expand All @@ -61,6 +51,18 @@ namespace usdi {
Body(VtArray<TfToken>, AttributeType::TokenArray, SdfValueTypeNames->TokenArray, TStringAttribute<VtArray<TfToken>>)\
Body(VtArray<SdfAssetPath>, AttributeType::AssetArray, SdfValueTypeNames->AssetArray, TStringAttribute<VtArray<SdfAssetPath>>)

//Body(half, AttributeType::Half, SdfValueTypeNames->Half, TAttribute<half>)\
//Body(GfVec2h, AttributeType::Half2, SdfValueTypeNames->Half2, TAttribute<GfVec2h>)\
//Body(GfVec3h, AttributeType::Half3, SdfValueTypeNames->Half3, TAttribute<GfVec3h>)\
//Body(GfVec4h, AttributeType::Half4, SdfValueTypeNames->Half4, TAttribute<GfVec4h>)\
//Body(GfQuath, AttributeType::QuatH, SdfValueTypeNames->Quath, TAttribute<GfQuath>)\
//Body(VtArray<half>, AttributeType::HalfArray, SdfValueTypeNames->HalfArray, TAttribute<VtArray<half>>)\
//Body(VtArray<GfVec2h>, AttributeType::Half2Array, SdfValueTypeNames->Half2Array, TAttribute<VtArray<GfVec2h>>)\
//Body(VtArray<GfVec3h>, AttributeType::Half3Array, SdfValueTypeNames->Half3Array, TAttribute<VtArray<GfVec3h>>)\
//Body(VtArray<GfVec4h>, AttributeType::Half4Array, SdfValueTypeNames->Half4Array, TAttribute<VtArray<GfVec4h>>)\
//Body(VtArray<GfQuath>, AttributeType::QuatHArray, SdfValueTypeNames->QuathArray, TAttribute<VtArray<GfQuath>>)\
template<class T> class TAttribute;
template<class T> class TStringAttribute;
template<class T, class InT> class TConverterAttribute;
Expand Down Expand Up @@ -376,7 +378,7 @@ typedef Attribute super;
m_usdattr.Get(&m_sample, t);
}

bool readSample(AttributeData& dst, Time t, bool copy) override
bool readSample(AttributeData& dst, Time t, bool /*copy*/) override
{
updateSample(t);

Expand Down Expand Up @@ -438,7 +440,7 @@ typedef Attribute super;
m_pointers.push_back(nullptr); // add null terminator for convenience
}

bool readSample(AttributeData& dst, Time t, bool copy) override
bool readSample(AttributeData& dst, Time t, bool /*copy*/) override
{
updateSample(t);

Expand Down Expand Up @@ -637,17 +639,17 @@ static struct InitConverterFactory
MakeConvertible(int64_t, Add(int));
MakeConvertible(uint64_t, Add(uint));

MakeConvertible(GfVec2h, Add(GfVec2f) Add(GfVec2d) Add(GfVec3h) Add(GfVec3f) Add(GfVec3d) Add(GfVec4h) Add(GfVec4f) Add(GfVec4d));
MakeConvertible(GfVec2f, Add(GfVec2h) Add(GfVec2d) Add(GfVec3h) Add(GfVec3f) Add(GfVec3d) Add(GfVec4h) Add(GfVec4f) Add(GfVec4d));
MakeConvertible(GfVec2d, Add(GfVec2h) Add(GfVec2f) Add(GfVec3h) Add(GfVec3f) Add(GfVec3d) Add(GfVec4h) Add(GfVec4f) Add(GfVec4d));
//MakeConvertible(GfVec2h, Add(GfVec2f) Add(GfVec2d) Add(GfVec3h) Add(GfVec3f) Add(GfVec3d) Add(GfVec4h) Add(GfVec4f) Add(GfVec4d));
//MakeConvertible(GfVec2f, Add(GfVec2h) Add(GfVec2d) Add(GfVec3h) Add(GfVec3f) Add(GfVec3d) Add(GfVec4h) Add(GfVec4f) Add(GfVec4d));
//MakeConvertible(GfVec2d, Add(GfVec2h) Add(GfVec2f) Add(GfVec3h) Add(GfVec3f) Add(GfVec3d) Add(GfVec4h) Add(GfVec4f) Add(GfVec4d));

MakeConvertible(GfVec3h, Add(GfVec2h) Add(GfVec2f) Add(GfVec2d) Add(GfVec3f) Add(GfVec3d) Add(GfVec4h) Add(GfVec4f) Add(GfVec4d));
MakeConvertible(GfVec3f, Add(GfVec2h) Add(GfVec2f) Add(GfVec2d) Add(GfVec3h) Add(GfVec3d) Add(GfVec4h) Add(GfVec4f) Add(GfVec4d));
MakeConvertible(GfVec3d, Add(GfVec2h) Add(GfVec2f) Add(GfVec2d) Add(GfVec3h) Add(GfVec3f) Add(GfVec4h) Add(GfVec4f) Add(GfVec4d));
//MakeConvertible(GfVec3h, Add(GfVec2h) Add(GfVec2f) Add(GfVec2d) Add(GfVec3f) Add(GfVec3d) Add(GfVec4h) Add(GfVec4f) Add(GfVec4d));
//MakeConvertible(GfVec3f, Add(GfVec2h) Add(GfVec2f) Add(GfVec2d) Add(GfVec3h) Add(GfVec3d) Add(GfVec4h) Add(GfVec4f) Add(GfVec4d));
//MakeConvertible(GfVec3d, Add(GfVec2h) Add(GfVec2f) Add(GfVec2d) Add(GfVec3h) Add(GfVec3f) Add(GfVec4h) Add(GfVec4f) Add(GfVec4d));

MakeConvertible(GfVec4h, Add(GfVec2h) Add(GfVec2f) Add(GfVec2d) Add(GfVec3h) Add(GfVec3f) Add(GfVec3d) Add(GfVec4f) Add(GfVec4d));
MakeConvertible(GfVec4f, Add(GfVec2h) Add(GfVec2f) Add(GfVec2d) Add(GfVec3h) Add(GfVec3f) Add(GfVec3d) Add(GfVec4h) Add(GfVec4d));
MakeConvertible(GfVec4d, Add(GfVec2h) Add(GfVec2f) Add(GfVec2d) Add(GfVec3h) Add(GfVec3f) Add(GfVec3d) Add(GfVec4h) Add(GfVec4f));
//MakeConvertible(GfVec4h, Add(GfVec2h) Add(GfVec2f) Add(GfVec2d) Add(GfVec3h) Add(GfVec3f) Add(GfVec3d) Add(GfVec4f) Add(GfVec4d));
//MakeConvertible(GfVec4f, Add(GfVec2h) Add(GfVec2f) Add(GfVec2d) Add(GfVec3h) Add(GfVec3f) Add(GfVec3d) Add(GfVec4h) Add(GfVec4d));
//MakeConvertible(GfVec4d, Add(GfVec2h) Add(GfVec2f) Add(GfVec2d) Add(GfVec3h) Add(GfVec3f) Add(GfVec3d) Add(GfVec4h) Add(GfVec4f));

MakeConvertible(GfMatrix2d, Add(GfMatrix2f));
MakeConvertible(GfMatrix3d, Add(GfMatrix3f));
Expand All @@ -672,11 +674,11 @@ Attribute* WrapExistingAttribute(Schema *parent, UsdAttribute usd)
#define Reinterpret(Sdf, T)\
if (tname == SdfValueTypeNames->Sdf) { return new TAttribute<T>(parent, usd); }\
if (tname == SdfValueTypeNames->Sdf##Array) { return new TAttribute<VtArray<T>>(parent, usd); }
Reinterpret(Vector3h, GfVec3h)
Reinterpret(Normal3h, GfVec3h)
Reinterpret(Point3h, GfVec3h)
Reinterpret(Color3h, GfVec3h)
Reinterpret(Color4h, GfVec4h)
//Reinterpret(Vector3h, GfVec3h)
//Reinterpret(Normal3h, GfVec3h)
//Reinterpret(Point3h, GfVec3h)
//Reinterpret(Color3h, GfVec3h)
//Reinterpret(Color4h, GfVec4h)
Reinterpret(Vector3f, GfVec3f)
Reinterpret(Normal3f, GfVec3f)
Reinterpret(Point3f, GfVec3f)
Expand Down
8 changes: 4 additions & 4 deletions Plugin/usdi/usdiContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,22 +432,22 @@ int Context::eachTimeSample(const TimeSampleCallback& cb)

auto& set = times.local();
if (Xform *xf = usdiAsXform(s)) {
xf->eachSample([&set](const XformData& data, Time t) {
xf->eachSample([&set](const XformData&, Time t) {
set.insert(t);
});
}
if (Camera *cam = usdiAsCamera(s)) {
cam->eachSample([&set](const CameraData& data, Time t) {
cam->eachSample([&set](const CameraData&, Time t) {
set.insert(t);
});
}
if (Mesh *mesh = usdiAsMesh(s)) {
mesh->eachSample([&set](const MeshData& data, Time t) {
mesh->eachSample([&set](const MeshData&, Time t) {
set.insert(t);
});
}
if (Points *points = usdiAsPoints(s)) {
points->eachSample([&set](const PointsData& data, Time t) {
points->eachSample([&set](const PointsData&, Time t) {
set.insert(t);
});
}
Expand Down
2 changes: 2 additions & 0 deletions Plugin/usdi/usdiInternal.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@

#include "MeshUtils/muVector.h"
namespace usdi {
PXR_NAMESPACE_USING_DIRECTIVE

using namespace mu;

class Context;
Expand Down
4 changes: 2 additions & 2 deletions Plugin/usdi/usdiSchema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ void Schema::setInstanceable(bool v) { m_prim.SetInstanceable(v); }
bool Schema::addReference(const char *asset_path, const char *prim_path)
{
if (!asset_path) { asset_path = ""; }
return m_prim.GetReferences().Add(SdfReference(asset_path, SdfPath(prim_path)));
return m_prim.GetReferences().AppendReference(SdfReference(asset_path, SdfPath(prim_path)));
}


Expand Down Expand Up @@ -368,7 +368,7 @@ bool Schema::beginEditVariant(const char *set, const char *variant)
return false;
}
else {
vset.FindOrCreateVariant(variant);
vset.AppendVariant(variant);
vset.SetVariantSelection(variant);
syncVariantSets();
m_ctx->beginEdit(vset.GetVariantEditTarget());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"Includes":["*/resources/"]
"Includes": [ "*/resources/" ]
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,20 @@ class "ClipsAPI" (
will be derived internally.

Important facts about clips:
li Within the layerstack in which clips are established, the
- Within the layerstack in which clips are established, the
opinions within the clips will be em weaker than any direct opinions
in the layerstack, but em stronger than varying opinions coming across
references and variants.
li We will never look for metadata or default opinions in clips
- We will never look for metadata or default opinions in clips
when performing value resolution on the owning stage, since these
quantities must be time-invariant.

This leads to the common structure in which we reference a model asset
on a prim, and then author clips at the same site: the asset reference
will provide the topology and unvarying data for the model, while
the clips will provide the time-sampled animation.

For further information, see \\ref Usd_Page_ValueClips
"""
)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3184,13 +3184,13 @@ class PointInstancer "PointInstancer" (

There is a pattern one can deploy for organizing the prototypes
such that they will automatically be skipped by basic UsdPrim::GetChildren()
or UsdTreeIterator traversals. Usd prims each have a
or UsdPrimRange traversals. Usd prims each have a
\"specifier\" of \"def\", \"over\", or \"class\". The
default traversals skip over prims that are \"pure overs\" or classes. So
to protect prototypes from all generic traversals and processing, place
them under a prim that is just an \"over\". For example,
\\code
01 def PxPointInstancer \"Crowd_Mid\"
01 def PointInstancer \"Crowd_Mid\"
02 {
03 rel prototypes = [ </Crowd_Mid/Prototypes/MaleThin_Business>, </Crowd_Mid/Prototypes/MaleTine_Casual> ]
04
Expand Down Expand Up @@ -3439,7 +3439,7 @@ class Camera "Camera" (
(x,y,z) with a * x + b * y + c * z + d * 1 < 0 where (x,y,z)
are the coordinates in the camera's space."""
)
float2 clippingRange = (1, 1e+06) (
float2 clippingRange = (1, 1000000) (
doc = """Near and far clipping distances in centimeters (or, more
general, world units)."""
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,6 @@
"documentation": "How a primvar interpolates across a primitive; equivalent to RenderMan's 'class specifier'",
"type": "token"
},
"renderType": {
"appliesTo": [
"attributes"
],
"displayGroup": "Rendering",
"type": "token"
},
"unauthoredValuesIndex": {
"appliesTo": [
"attributes"
Expand Down Expand Up @@ -119,7 +112,8 @@
"autoGenerated": true,
"bases": [
"UsdGeomPointBased"
]
],
"implementsComputeExtent": true
},
"UsdGeomCylinder": {
"alias": {
Expand Down Expand Up @@ -173,7 +167,8 @@
"autoGenerated": true,
"bases": [
"UsdGeomGprim"
]
],
"implementsComputeExtent": true
},
"UsdGeomPointInstancer": {
"alias": {
Expand All @@ -191,7 +186,8 @@
"autoGenerated": true,
"bases": [
"UsdGeomPointBased"
]
],
"implementsComputeExtent": true
},
"UsdGeomScope": {
"alias": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@ class PShader "PShader"
asset sloPath
}

class Subgraph "Subgraph" (
doc = '''A subgraph is a container for shading nodes, as well as other
subgraphs. It has a public input interface and provides a list of public
outputs, called terminals.
class NodeGraph "NodeGraph" (
doc = '''A node-graph is a container for shading nodes, as well as other
node-graphs. It has a public input interface and provides a list of public
outputs.

<b>Subgraph Interfaces</b>
<b>Node Graph Interfaces</b>

One of the most important functions of a Subgraph is to host the "interface"
One of the most important functions of a node-graph is to host the "interface"
with which clients of already-built shading networks will interact. Please
see "Interface Attributes" for a detailed
explanation of what the interface provides, and how to construct and
use it to effectively share/instance shader networks.

<b>Terminals</b>
<b>Node Graph Outputs</b>

Analogous to the public interface, these are relationships that each point
to a single internal shader output.
These behave like outputs on a shader and are typically connected to an
output on a shader inside the node-graph.
'''
)
{
Expand Down Expand Up @@ -160,3 +160,12 @@ class Shader "Shader" (
)
}

class "ConnectableAPI" (
doc = """UsdShadeConnectableAPI is an API schema that provides a common
interface for creating outputs and making connections between shading
parameters and outputs.
"""
)
{
}

Loading

0 comments on commit f022eb4

Please sign in to comment.