diff --git a/source/JsMaterialX/JsMaterialXCore/JsProperty.cpp b/source/JsMaterialX/JsMaterialXCore/JsProperty.cpp index 40b575d98b..1c8948ea3f 100644 --- a/source/JsMaterialX/JsMaterialXCore/JsProperty.cpp +++ b/source/JsMaterialX/JsMaterialXCore/JsProperty.cpp @@ -24,6 +24,10 @@ EMSCRIPTEN_BINDINGS(property) .smart_ptr>("Property") .class_property("CATEGORY", &mx::Property::CATEGORY); + std::string mx__PropertyAssign__PROPERTY_ATTRIBUTE = mx::PropertyAssign::PROPERTY_ATTRIBUTE; + std::string mx__PropertyAssign__GEOM_ATTRIBUTE = mx::PropertyAssign::GEOM_ATTRIBUTE; + std::string mx__PropertyAssign__COLLECTION_ATTRIBUTE = mx::PropertyAssign::COLLECTION_ATTRIBUTE; + ems::class_>("PropertyAssign") .smart_ptr_constructor("PropertyAssign", &std::make_shared) .smart_ptr>("PropertyAssign") @@ -39,9 +43,9 @@ EMSCRIPTEN_BINDINGS(property) .function("setCollection", &mx::PropertyAssign::setCollection) .function("getCollection", &mx::PropertyAssign::getCollection) .class_property("CATEGORY", &mx::PropertyAssign::CATEGORY) - .class_property("PROPERTY_ATTRIBUTE", &mx::PropertyAssign::PROPERTY_ATTRIBUTE) - .class_property("GEOM_ATTRIBUTE", &mx::PropertyAssign::GEOM_ATTRIBUTE) - .class_property("COLLECTION_ATTRIBUTE", &mx::PropertyAssign::COLLECTION_ATTRIBUTE); + .class_property("PROPERTY_ATTRIBUTE", &mx__PropertyAssign__PROPERTY_ATTRIBUTE) + .class_property("GEOM_ATTRIBUTE", &mx__PropertyAssign__GEOM_ATTRIBUTE) + .class_property("COLLECTION_ATTRIBUTE", &mx__PropertyAssign__COLLECTION_ATTRIBUTE); ems::class_>("PropertySet") .smart_ptr_constructor("PropertySet", &std::make_shared) @@ -67,7 +71,9 @@ EMSCRIPTEN_BINDINGS(property) BIND_PROPERTYSET_TYPE_INSTANCE(StringArray, mx::StringVec) .function("getPropertyValue", &mx::PropertySet::getPropertyValue) .class_property("CATEGORY", &mx::Property::CATEGORY); - + + std::string mx__PropertySetAssign__COLLECTION_ATTRIBUTE = mx::PropertySetAssign::PROPERTY_SET_ATTRIBUTE; + ems::class_>("PropertySetAssign") .smart_ptr_constructor("PropertySetAssign", &std::make_shared) .smart_ptr>("PropertySetAssign") @@ -77,5 +83,5 @@ EMSCRIPTEN_BINDINGS(property) .function("setPropertySet", &mx::PropertySetAssign::setPropertySet) .function("getPropertySet", &mx::PropertySetAssign::getPropertySet) .class_property("CATEGORY", &mx::PropertySetAssign::CATEGORY) - .class_property("PROPERTY_SET_ATTRIBUTE", &mx::PropertySetAssign::PROPERTY_SET_ATTRIBUTE); + .class_property("PROPERTY_SET_ATTRIBUTE", &mx__PropertySetAssign__COLLECTION_ATTRIBUTE); } diff --git a/source/MaterialXCore/Property.cpp b/source/MaterialXCore/Property.cpp index 1374b80dd4..a1e9d1aef1 100644 --- a/source/MaterialXCore/Property.cpp +++ b/source/MaterialXCore/Property.cpp @@ -7,10 +7,10 @@ MATERIALX_NAMESPACE_BEGIN -const string PropertyAssign::PROPERTY_ATTRIBUTE = "property"; -const string PropertyAssign::GEOM_ATTRIBUTE = "geom"; -const string PropertyAssign::COLLECTION_ATTRIBUTE = "collection"; -const string PropertySetAssign::PROPERTY_SET_ATTRIBUTE = "propertyset"; +const char* PropertyAssign::PROPERTY_ATTRIBUTE = "property"; +const char* PropertyAssign::GEOM_ATTRIBUTE = "geom"; +const char* PropertyAssign::COLLECTION_ATTRIBUTE = "collection"; +const char* PropertySetAssign::PROPERTY_SET_ATTRIBUTE = "propertyset"; // // PropertyAssign methods diff --git a/source/MaterialXCore/Property.h b/source/MaterialXCore/Property.h index b03be00149..c4b76b19a5 100644 --- a/source/MaterialXCore/Property.h +++ b/source/MaterialXCore/Property.h @@ -141,9 +141,9 @@ class MX_CORE_API PropertyAssign : public ValueElement public: static const string CATEGORY; - static const string PROPERTY_ATTRIBUTE; - static const string GEOM_ATTRIBUTE; - static const string COLLECTION_ATTRIBUTE; + static const char* PROPERTY_ATTRIBUTE; + static const char* GEOM_ATTRIBUTE; + static const char* COLLECTION_ATTRIBUTE; }; /// @class PropertySet @@ -263,7 +263,7 @@ class MX_CORE_API PropertySetAssign : public GeomElement public: static const string CATEGORY; - static const string PROPERTY_SET_ATTRIBUTE; + static const char* PROPERTY_SET_ATTRIBUTE; }; MATERIALX_NAMESPACE_END