object position aov with Karma?

   627   8   1
User Avatar
Member
94 posts
Joined:
Offline
So a quick question here: What is the best/easiest way to set up an object position aov or pass with karma/materialX?
I know that we can very easily output a world position or camera position aov, but I am looking for an object position aov.

Thanks,

Dag
User Avatar
Member
250 posts
Joined: Jan. 2015
Offline
1. Add rest as a primvar.
2. Create a primvar AOV set to rest, with https://www.sidefx.com/docs/houdini/nodes/lop/karmastandardrendervars.html [www.sidefx.com]

This is the closest I know of.
User Avatar
Member
9225 posts
Joined: July 2007
Offline
Karma Ray Import (Vector3 ray:hitP) -> MtlX Transform Point (fromspace: world, tospace: object)
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
94 posts
Joined:
Offline
Thanks guys! I will try both of these solutions.
User Avatar
Member
94 posts
Joined:
Offline
@tamte and @Heilef
and others of course.

1. It looks to me like transforming from world to object space does not work as advertised. I've attached a little example scene to showcase the issue. Basically I see no visible difference between a transform world:world or world:object. And, as the object in my scene has animation on it you can clearly see that it is just swimming through the "space". There is a switch in the example scene that switches between modes, and the only one that results in no change at all (from regular world space) is the world:object So, what is wrong here? Have I done something wrong or is this a genuine bug?

2. It seems like the thing that does work predictably is to output the rest position. But, that would mean that every object in my scene would have to have a rest position to begin with, which in my case is fine, but in more complex scenes could become a bit annoying to set up, especially if you have to do it after you've sort of finished the scene already.

Would be interested in your perspectives on this.

Thanks,
Dag
Edited by Dougie0047 - July 3, 2025 14:44:48

Attachments:
object_space_issue.hiplc (1.0 MB)

User Avatar
Member
9225 posts
Joined: July 2007
Offline
your /box Xform contains no actual transform so it is the same as world

all your animation is done on the geometry of the box so you are animating the points which results in timesamples on points primar on /box/mesh0 which is technically a deformation
and for deforming geo you would need to use "rest"

but if your /box had animated transform with static geo inside you would see expected Object space P values

here is a modified scene with all animation being done on object level and imported through Scene Import with static box inside

you can similarly also use packed prims for this purpose if you want to animate within SOPs
Edited by tamte - July 3, 2025 15:30:33

Attachments:
object_space_issue_fix.hipnc (1.0 MB)

Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
9225 posts
Joined: July 2007
Offline
and here is an example of boxes animated on SOP level after packing (in this case using RBD) and then imported as animated Xforms

Attachments:
object_space_issue_fix_packed.hipnc (1.5 MB)

Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
62 posts
Joined: July 2007
Offline
Thanks for this, Thomas (@tamte). It helped with a long standing question I had.
The issue I now have is that Ii can't seem to pipe the aov into materialx shaders, only karmamaterialbuilder.
The materialx material builder has different ray options and the materil itself doesn't have the AOV output on the subnet outputs.
I tried setting up the same node setup in mtlx material builder as in the karma material builder but it doesn't come out in the aov pass.
What am I missing?
Image Not Found


I have an enomous amount of Kitbash materials that come in with the assets and it's not feasible to rebuild all the materials in karmamaterialbuilder nodes.
Edited by Lenscowboy - July 4, 2025 05:13:04

Attachments:
Screenshot 2025-07-04 110631.png (8.1 KB)
Screenshot 2025-07-04 110719.png (7.7 KB)
Screenshot 2025-07-04 111011.png (32.1 KB)
Screenshot 2025-07-04 111053.png (55.3 KB)

User Avatar
Member
94 posts
Joined:
Offline
@tamte
Thank you for the explanation. This makes total sense.

Cheers,
Dag
  • Quick Links