sopmodify - import primvar from camera

   1169   1   0
User Avatar
Member
15 posts
Joined: Feb. 2018
Offline
need to get primvar values (focalLength) of a camera lop inside a sopmodify/sopcreate. Fetching the packed usd primitive is straightforward but I cant figure out how to read specific primvars from it. the usd_primvar vex function just always returns 0. seems simple but I'm pretty stuck here.
that's the primwrangle code I'm using inside a sopmodify (which imports the camera primitive)
float focal =  usd_primvar("/stage", s@path, "focalLength");
Edited by nvki - April 9, 2021 11:55:06

Attachments:
primvar.hiplc (434.3 KB)

User Avatar
Member
15 posts
Joined: Feb. 2018
Offline
so I thought I was working with primvars when in reality it was usd attributes. with a wrangle LOP I can now copy usd attribs/primvars from the camera to a target prim. When unpacking it in the sopmodify there's an option to import usd attributes/primvars, and I get the copied attribute as a primitive attribute in sops.

is there a more straightforward way to import a primvar as a detail attribute tho? i suspect the usd_attrib function doesnt work in a SOP wrangle because theres no stage handle available? then again theres a 90% chance its user error... ^^
Edited by nvki - April 9, 2021 17:23:30

Attachments:
frustum_clip.hiplc (445.1 KB)

  • Quick Links