-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lanierd/hydra 1054 #169
Lanierd/hydra 1054 #169
Changes from 7 commits
684207a
0d5c231
a7a045a
5ea3b86
767ef3a
1fa6f2a
4af679e
9e587c5
deda6be
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,13 +22,33 @@ | |
#include <pxr/imaging/hd/materialBindingsSchema.h> | ||
#include <pxr/imaging/hd/containerDataSourceEditor.h> | ||
#include <pxr/imaging/hd/retainedDataSource.h> | ||
#include <pxr/usd/usdGeom/tokens.h> | ||
|
||
namespace FVP_NS_DEF { | ||
|
||
PXR_NAMESPACE_USING_DIRECTIVE | ||
|
||
namespace{ | ||
static const TfToken purposes[] = { HdMaterialBindingsSchemaTokens->allPurpose }; | ||
|
||
// Support implicit surfaces from USD as well, not only meshes | ||
bool _IsDefaultMaterialCompliantPrimitive(const TfToken& primType) | ||
{ | ||
static VtArray<TfToken> const compliantPrimitives = { HdPrimTypeTokens->cone, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor: would be slightly better as an std::set, with the check using either std::set::find() or std::set::count(). |
||
HdPrimTypeTokens->cylinder, | ||
HdPrimTypeTokens->cylinder_1, | ||
HdPrimTypeTokens->cube, | ||
HdPrimTypeTokens->sphere, | ||
HdPrimTypeTokens->capsule, | ||
HdPrimTypeTokens->capsule_1, | ||
#if HD_API_VERSION >= 67 // USD 24.05+ | ||
UsdGeomTokens->TetMesh, | ||
#endif | ||
UsdGeomTokens->Plane, | ||
HdPrimTypeTokens->mesh}; | ||
return std::find(compliantPrimitives.cbegin(), compliantPrimitives.cend(), primType) | ||
!= compliantPrimitives.cend(); | ||
lanierd-adsk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} | ||
|
||
// static | ||
|
@@ -67,8 +87,7 @@ HdSceneIndexPrim DefaultMaterialSceneIndex::GetPrim(const SdfPath& primPath) con | |
|
||
bool DefaultMaterialSceneIndex::_ShouldWeApplyTheDefaultMaterial(const HdSceneIndexPrim& prim)const | ||
{ | ||
// Only for meshes so far | ||
if (HdPrimTypeTokens->mesh != prim.primType) { | ||
if (! _IsDefaultMaterialCompliantPrimitive(prim.primType)) { | ||
return false; | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,6 +78,11 @@ SdfPath DagPathToSdfPath( | |
const bool stripNamespaces) | ||
{ | ||
std::string name = dagPath.fullPathName().asChar(); | ||
if ( name.empty() ) { | ||
MFnDependencyNode dep(dagPath.node()); | ||
TF_WARN("Empty fullpath name for DAG object : %s of type : %s", dep.name().asChar(), dep.typeName().asChar()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we know when this happens? Is this for non-Dag nodes? Does this indicate missing functionality, missing logic, or a bug? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had this with Bifrost nodes and also when selecting the default material set. But the problem is that wer get dag nodes with no type and no name, we should try detect useful dag nodes that need to be translated as some may not need to be treated. |
||
return SdfPath(); | ||
} | ||
SanitizeNameForSdfPath(name, stripNamespaces); | ||
SdfPath usdPath(name); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Github is erroring out saying that "You need to add a comment indicating the requested change.", even though I've done exactly that. Hoping that this additional comment will help.