Extract Solaris Camera Position to SOP Geometry

   1558   4   1
User Avatar
Member
23 posts
Joined: Dec. 2019
Offline
Hello, I'm majorly stuck on this issue where I need to change SOP geometry attributes relative to the active camera's position in Solaris.

To drive a material and attributes dependent on camera position, I need to somehow get the active Solaris camera position dependent on the camera's primitive path in Solaris is always "/cameras/camera".

I have no idea on how to go about this at all really since everything I try won't give me the camera position of whichever camera currently displays "/cameras/camera". I have attached an example scene which describes what I'm currently doing and what and where I need to get the positions from and to.

I would be extremely grateful for any help I can get with this, or any idea on how to maybe approach this at all.

Thank you very much for your time ^^
Edited by Yannik - July 10, 2024 06:41:50

Attachments:
animated attribute dependent on camera pos.hiplc (443.7 KB)

User Avatar
Member
165 posts
Joined: July 2005
Offline
For camera position compared to geo there's a few ways, one is to use a lop camera import obj, then object merge (with 'into this object' on) that into a sop modify LOP with unpack on. That gives you the camera origin as a point to compare position to any geometry. There's a distance from geometry node that outputs a dist attribute that can then go into a remap attribute so it takes the camera dist range from 0 to whatever so its between 0 an 1 and rename it to Cd or other.

For cam angle to points or prim I'm not aware of a non-vex way.
If you need more camera parameters than than cam pos you can get cam path + the parameter names then the values in vex in a point wrangle.
You can also use usd vex in sops to get that. Or you can change attributes in a wrangle LOP with run over points and use USD vex to get camera info. etc but its vex or vops.
User Avatar
Member
23 posts
Joined: Dec. 2019
Offline
GrahamDClark
For camera position compared to geo there's a few ways, one is to use a lop camera import obj, then object merge (with 'into this object' on) that into a sop modify LOP with unpack on. That gives you the camera origin as a point to compare position to any geometry.

Hey, thank you so much for getting back to me, @GrahamDClark.
I was unable to reproduce your instructions here to get the active stage / LOP's cameras position (I'm pretty new and unfamiliar with Solaris).
But I have created an example scene file which shows you the desired effect.
All I'm missing is how to get the camera position of the primitive path "/cameras/camera" as the camera is animated and changes.

If you could take a look at my setup and add the by you described nodes in the correct way to get the camera position, I would be extremely grateful.
Edited by Yannik - July 10, 2024 06:42:13

Attachments:
animated attribute dependent on camera pos.hiplc (443.7 KB)

User Avatar
Member
165 posts
Joined: July 2005
Offline
added objnet with lop import cam inside, and an object merge set to into this object

Attachments:
animated attribute dependent on camera pos.hipnc (890.3 KB)

User Avatar
Member
143 posts
Joined: Nov. 2017
Offline
You can access the usd_attrib(utes) and usd_localtransform(s) from a wrangle node in sops. Just make sure that there's a file node inbetween this query and the export to lops. Otherwise there's a problem (infinite loop).

No need for a lop camera import if this is possible.
Edited by Tom Mangold - March 14, 2025 05:06:55
  • Quick Links