SetUniqueIP gets lost
-
Let me try to explain what I need/want...
-
Inside the InitRender function I go through all the objects that are affected by the shader (the list of obtained from the VolumeData) and I assign a unique number to each, using SetUniqueIP.
-
Inside the Output function I read the unique number assigned to the object, using GetUniqueIP.
However, I already noticed that the objects that I get inside the Output function are polygonal objects, meaning that it is already a converted version of the original objects that I got in the InitRender function.
So, I guess that is why the UniqueIP gets lost.I also tried, inside the InitRender function, getting the object container, add it a new sub-container with an Int32 data container a unique number and loading back the modified container to the object, but it also seems not to carry over to the converted object.
So, is there any way to store a unique number (an Int32) in an object so that it survives the conversion to polygon that I get in the Output function? -
-
It work now!! I don't know why it wasn't working but it was surely my mistake.
-
Hi @rui_mac,
from your explanation it seems you're misunderstanding how the unique IP is supposed to function in cinema. Namely, with the SetUniqueIP() function one should assign a unique identification number to an object of a generator, which creates a hierarchy (i.e. more than one object). One's also supposed to use OBJECT_UNIQUEENUMERATION bit in such case. Inside Output you get polygonized representation of your scene (you can think of it as there's no concept of generator anymore), hence you're just lucky that you're getting back your unique IP there, or in other words you're not supposed to get it there.
I suspect what you're trying to achieve is to assign some custom data in InitRender and later access it in the Output. If that's the case, you can implement a tag and assign your data to this tag. This would allow you to access this tag in the Output function, because your tag will be carried over during the "baking" process.
For more info on tags please check the BaseTag and VariableTag Manual.
Cheers,
Ilia -
Well, I got lucky, then
As I'm assigning a set of IDs to the objects, using SetUniqueIP inside the InitRender function and I'm being able to read then back inside the Output function, with GetUniqueIP.I mean... my shader is working fine now, and I just need to polish it a bit.