Support rel material:binding syntax(define only)

This commit is contained in:
Syoyo Fujita
2023-09-28 22:59:26 +09:00
parent c75ed6b2eb
commit 68a8632d33
4 changed files with 17 additions and 2 deletions

View File

@@ -1297,7 +1297,7 @@ static ParseResult ParseShaderInputConnectionProperty(std::set<std::string> &tab
return ret;
}
// Rel with single targetPath
// Rel with single targetPath(or empty)
#define PARSE_SINGLE_TARGET_PATH_RELATION(__table, __prop, __propname, __target) \
if (prop.first == __propname) { \
if (__table.count(__propname)) { \
@@ -1320,6 +1320,11 @@ static ParseResult ParseShaderInputConnectionProperty(std::set<std::string> &tab
continue; \
} \
PUSH_ERROR_AND_RETURN(fmt::format("`{}` target is empty or has mutiple Paths. Must be single Path.", __propname)); \
} else if (!rel.has_value()) { \
/* define-only. accept */ \
__target = rel; \
table.insert(prop.first); \
DCOUT("Added rel " << __propname); \
} else { \
PUSH_ERROR_AND_RETURN(fmt::format("`{}` target must be Path.", __propname)); \
} \

View File

@@ -892,7 +892,8 @@ struct PrimMetas {
// For backward compatibility
using PrimMeta = PrimMetas;
// Metadata for Attribute
// Metadata for Property(Relationship and Attribute)
// TODO: Rename to PropMetas
struct AttrMetas {
// frequently used items
// nullopt = not specified in USD data
@@ -935,6 +936,8 @@ struct AttrMetas {
// For backward compatibility
using AttrMeta = AttrMetas;
using PropMetas = AttrMetas;
// Typed TimeSamples value
//
// double radius.timeSamples = { 0: 1.0, 1: None, 2: 3.0 }

View File

@@ -0,0 +1,7 @@
#usda 1.0
def Xform "geom"
{
rel material:binding
}

Binary file not shown.