mirror of
https://github.com/lighttransport/tinyusdz.git
synced 2026-01-18 01:11:17 +01:00
Support rel material:binding syntax(define only)
This commit is contained in:
@@ -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)); \
|
||||
} \
|
||||
|
||||
@@ -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 }
|
||||
|
||||
7
tests/usda/material-binding-003.usda
Normal file
7
tests/usda/material-binding-003.usda
Normal file
@@ -0,0 +1,7 @@
|
||||
#usda 1.0
|
||||
|
||||
def Xform "geom"
|
||||
{
|
||||
rel material:binding
|
||||
|
||||
}
|
||||
BIN
tests/usdc/material-binding-003.usdc
Normal file
BIN
tests/usdc/material-binding-003.usdc
Normal file
Binary file not shown.
Reference in New Issue
Block a user