Authoring USD primvars of boolean type using Vex

   1247   2   0
User Avatar
Member
240 posts
Joined: Oct. 2014
Offline
What is the proper way to author bool-type USD primvars using an AttributeWrangle LOP. For example, and this is hypothetical, if we to set an object to render as a Matte object in Karma, using a RenderGeometrySettings LOP generates the following on the prim:

primvars:karma:object:ismatte    bool[1]:[True]

I'm trying to figure out how I can set this using Vex instead. Bumping on the data type though. Can't figure out how to set a (USD) Boolean in Vex.
Edited by Tim Crowson - May 25, 2022 15:32:05
- Tim Crowson
Technical/CG Supervisor
User Avatar
Member
169 posts
Joined: Nov. 2013
Offline
usd_addprimvar(0, "/sphere1", "bool_primvar", "bool[]");
int myindex[];
append(myindex,0);
usd_setprimvar(0, "/sphere1", "bool_primvar", myindex);
User Avatar
Member
8539 posts
Joined: July 2007
Online
you may be talking about 18.5 since you are still mentioning bool primvars:karma:object:ismatte (since 19.0 uses int primvars:karma:object:holdoutmode)

but in 19.0, you can bind bool properties as int
you can just do
i@mybool = 1;
and in Binding tab, add a new binding, set type to bool, VEX Parameter to: mybool, and Attribute name to the name of property or primvar you want to create or edit
Tomas Slancik
FX Supervisor
Method Studios, NY
  • Quick Links