Search - User list
Full Version: change displayColor with attWrangle
Root » Solaris and Karma » change displayColor with attWrangle
martinkindl83
Hello guys.
I'm trying to port some custom HDAs into Solaris and i struggle even with simple VEX expression to change displayColor

Anyone would be able to help how to change the displayColor with VEX?

I managed to get to this stage, but that creates different type (color3f), then then USD displayColor expects (color3f).
I just was not able to get the correct type, thus the Array


string att_name =chs("att_name");
string primitive = chs("primpattern");
usd_addprimvar(0, primitive, att_name, "color3f[]", "constant");
usd_setprimvar(0, primitive, att_name,  vector[] (array({0,0,0},{0,0,0} , {1,1,1})));
jsmack
I find it's easier to use bound attributes rather than the usd functions directly. For really fancy stuff (large per vertex arrays) it's much easier and probably more performant too to use sops.
martinkindl83
Thank you.
Would this work for alembic brought by file node as well?
jsmack
martinkindl83
Thank you.
Would this work for alembic brought by file node as well?

All data in USD is fair game, except for primitives that are children of an instanceable primitive.

By file node do you mean sublayer or reference lop?
martinkindl83
jsmack
By file node do you mean sublayer or reference lop?

Originally i was using Alembic node at sops and sopimporting. You mentioned its not the right way how to bring alembic, so i tried File, which is by looking at the name Sublayer node.
martinkindl83
Thank you for the example, it worked as expected
string att_name =chs("att_name");
string primitive = chs("primpattern");
usd_addprimvar(0, primitive, att_name, "color3f[]", "constant");
usd_setprimvar(0, primitive, att_name,  vector[](array({0,1,0})));
martinkindl83
also why are you having second line in the vex? is it just safety thing?
As it looks, like the first line already creates constant interpolation.

v[]@primvars:displayColor = array(vector(rand(@elemnum)));
usd_setprimvarinterpolation(0, @primpath, "displayColor", "constant");
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB