MaterialX icon indicating copy to clipboard operation
MaterialX copied to clipboard

Accessing the default color value for images in the Javascript bindings

Open hybridherbst opened this issue 6 months ago • 1 comments

I'm trying to understand how to get the default value for an <image> from the Javascript bindings.

Example MaterialX:

<image name="tex" type="color4" >
	<input name="file" type="filename" interfacename="_MyColorMap" uniform="true" />
	<input name="texcoord" type="vector2" nodename="vector3_to_vector2" />
	<input name="default" type="color4" value="1.0, 1.0, 1.0, 1.0" />
</image>

My understanding is that there should be a way to access that "default" value so that applications have a chance of constructing the correct fallback texture.

Is this missing in the bindings here? Or is there a better place to look? https://github.com/AcademySoftwareFoundation/MaterialX/blob/87c4a2bcf411a4ae601586220a3f1995ae5344ae/source/JsMaterialX/JsMaterialXGenShader/JsShaderNode.cpp#L17-L26

hybridherbst avatar Jul 04 '25 13:07 hybridherbst

Good question, @hybridherbst, and I'm CC'ing @kwokcb for his expertise in this area of the code.

jstone-lucasfilm avatar Jul 07 '25 17:07 jstone-lucasfilm