Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions source/JsMaterialX/JsMaterialXCore/JsProperty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ EMSCRIPTEN_BINDINGS(property)
.smart_ptr<std::shared_ptr<const mx::Property>>("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_<mx::PropertyAssign, ems::base<mx::ValueElement>>("PropertyAssign")
.smart_ptr_constructor("PropertyAssign", &std::make_shared<mx::PropertyAssign, mx::ElementPtr, const std::string &>)
.smart_ptr<std::shared_ptr<const mx::PropertyAssign>>("PropertyAssign")
Expand All @@ -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_<mx::PropertySet, ems::base<mx::Element>>("PropertySet")
.smart_ptr_constructor("PropertySet", &std::make_shared<mx::PropertySet, mx::ElementPtr, const std::string &>)
Expand All @@ -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_<mx::PropertySetAssign, ems::base<mx::GeomElement>>("PropertySetAssign")
.smart_ptr_constructor("PropertySetAssign", &std::make_shared<mx::PropertySetAssign, mx::ElementPtr, const std::string &>)
.smart_ptr<std::shared_ptr<const mx::PropertySetAssign>>("PropertySetAssign")
Expand All @@ -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);
}
8 changes: 4 additions & 4 deletions source/MaterialXCore/Property.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions source/MaterialXCore/Property.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down