Op_Id - extract image plane

   27254   31   5
User Avatar
Member
1145 posts
Joined: July 2005
Offline
In Mantra I'm suppose to be able to identify Objects by their ID as separate, extra image planes. I'd like to try this for compositing.
What is the syntax for that? What do I put in the Vex Variable field?
“gravity is not a force, it is a boundary layer”
“everything is coincident”
“Love; the state of suspended anticipation.”
User Avatar
Member
401 posts
Joined:
Offline
I just read this today in the help:



You can output the object ID and/or primitive IDs to deep raster planes, and then use them to easily select objects or primitives in the compositor.

To output the object or primitive ID, set up the following parameters:

* Variable name = Op_Id (or Prim_Id)
* File/Plane name = Op_Id (or Prim_Id)
* Channel depth, Variable type = Floating point
* Sample filter = closest surface
* Pixel filter = minmax idcover (a special filtering mode for ID channels)

Georg
this is not a science fair.
User Avatar
Member
1145 posts
Joined: July 2005
Offline
Thanks Georg, I read that as well, but I don't know what it means with regards to what actually goes in the parameter field.
“gravity is not a force, it is a boundary layer”
“everything is coincident”
“Love; the state of suspended anticipation.”
User Avatar
Member
401 posts
Joined:
Offline
I think it's just what is says.

Though the output looks rather *frikkl'd*. Reminds me of long forgotten video art.
We used to say: Well, other people render such stuff …

But I think this is some quantization issue.

Attachments:
prim_id.hip (171.8 KB)
prim_id.2.jpg (90.2 KB)

this is not a science fair.
User Avatar
Member
1390 posts
Joined: July 2005
Offline
I'm not sure if this is not a bug, since for Op_Id in 32 float I always get 1…
or 0 for renderstate(“object:id”, state) syntax in surface shader.
Edited by - Feb. 15, 2008 17:11:42
User Avatar
Member
1145 posts
Joined: July 2005
Offline
Ah!!! okay. Thanks guys. I was assuming user error cause I was getting white frames. Perhaps there is a problem.
“gravity is not a force, it is a boundary layer”
“everything is coincident”
“Love; the state of suspended anticipation.”
User Avatar
Member
1145 posts
Joined: July 2005
Offline
Got it. The value(Vex Type) is a Float not a Vector.
“gravity is not a force, it is a boundary layer”
“everything is coincident”
“Love; the state of suspended anticipation.”
User Avatar
Member
401 posts
Joined:
Offline
ops:
this is not a science fair.
User Avatar
Member
1145 posts
Joined: July 2005
Offline
Now that I have that part, all I have to do is figure out how to use it in the compositor
I'm angling to see if it's good for re-lighting and such.
“gravity is not a force, it is a boundary layer”
“everything is coincident”
“Love; the state of suspended anticipation.”
User Avatar
Member
12429 posts
Joined: July 2005
Online
Yes, it should be: it appeared in Mantra at the exact same moment the IPR pane allowed the user to pick objects directly in the image - so it's already been used for re-lighting
Jason Iversen, Technology Supervisor & FX Pipeline/R+D Lead @ Weta FX
also, http://www.odforce.net [www.odforce.net]
User Avatar
Member
1145 posts
Joined: July 2005
Offline
Great, looking forward to having IPR back as well.
However, I'm not clear on how you identify individual objects in a scene. I'm assuming you can identify an individual object with the “Prim_ID”, but if you just put that in the Vex field you get all the objects in the scene.
Do you have to isolate an object into its own mantra? If so then I don't see the advantage of Prim_Id.
“gravity is not a force, it is a boundary layer”
“everything is coincident”
“Love; the state of suspended anticipation.”
User Avatar
Member
1390 posts
Joined: July 2005
Offline
hmm… for me it's still the same. Double checked. All objects have ID == 1.
Which is close to useless… Bug or still didn't get this voodoo (although I used to haven't problems in H8.2)

H9.1.141, Ubuntu32.

EDIT:
Prim_Id works as expected.
User Avatar
Member
1192 posts
Joined: July 2005
Offline
SYmek
hmm… for me it's still the same. Double checked. All objects have ID == 1.
Which is close to useless… Bug or still didn't get this voodoo (although I used to haven't problems in H8.2)

H9.1.141, Ubuntu32.

EDIT:
Prim_Id works as expected.
I reported this to support long time ago, and after some back and forth emails and I got this answer:
Put down a Mantra Output Driver.
Edit Rendering Parameters
In the filter type “ids”
Open up “Mantra->Output”
Install “Generate Op Ids for objects (vm_generate_opid)”
Turn this parameter on.
See screen shot for extra help.


I can't check right now, I remember that it worked then (H9, not 9.1 at the time).

Attachments:
opid.png (114.3 KB)

Dragos Stefan
producer + director @ www.dsg.ro
www.dragosstefan.ro
User Avatar
Member
1390 posts
Joined: July 2005
Offline
thanks again digitallysane!

I think I will have to catch a good habit to check “Edit Rendering Parameters” every time something goes wrong . that's a pretty odd habit actually.


cheers,
sy.
User Avatar
Member
1145 posts
Joined: July 2005
Offline
You have to be patience with a geriatric like me.

Can I render a Prim_Id layer with only a specific primitive in it? If so, what is the syntax?
So, as in Georg's example, the Vex Variable is Prim_Id, which gives me all the “boxes” as a matte. Can I declare just one of the primitives?
Or is this information embedded in the image? If so, how do you access it?
“gravity is not a force, it is a boundary layer”
“everything is coincident”
“Love; the state of suspended anticipation.”
User Avatar
Member
1192 posts
Joined: July 2005
Offline
If you inspect the plane you'll see that the channel has a different value at each prim (or Object in the case of Op_ID).
So for example for some Object the Op_ID plane will have the value 3 (let's say). So you have to check where the value of the channel is 3 and output a value of 1 in some matte channel or in your effect multiplier.

Dragos
Dragos Stefan
producer + director @ www.dsg.ro
www.dragosstefan.ro
User Avatar
Member
1145 posts
Joined: July 2005
Offline
I see it, thanks. One problem though, it looks like there's no 0 primitive. All the prim numbers are advanced by 1.
“gravity is not a force, it is a boundary layer”
“everything is coincident”
“Love; the state of suspended anticipation.”
User Avatar
Member
1390 posts
Joined: July 2005
Offline
Well, of course, since 0 means nothing == black background
User Avatar
Member
1145 posts
Joined: July 2005
Offline
You're right, that almost, kinda makes sense. However, that prim number isn't being embedded as a colour(it's just a float) so I don't see the purpose of the shift.
“gravity is not a force, it is a boundary layer”
“everything is coincident”
“Love; the state of suspended anticipation.”
User Avatar
Member
1390 posts
Joined: July 2005
Offline
Maybe I don't understand your doubt. Feel like we talk on different topic. But 0 is a colour anyway just expressed in a grey scale…

Imagine just one primitive on your screen, that you need to make a mask for with Prim_Id plate. In minimal example, just for one prim, you need two colours, not one, don't you? So the first one is always 0…

Good explanation is common object ID generated from other application like Max, they are encoded in “real” colours, not in one float. Objects are coloured but surrounding is black.
  • Quick Links