There are some strange things happening when using VRayInstancer related to Render-IDs. I see this in V-Ray 5 Update 1 and earlier.
Any Source object that is used for VRayInstancer will report a Node-Render-ID of 1 (C++: INode::GetRenderID() or MAXScript: GetRenderID(node)). This only happens if the source object is actually instanced. So as long as a particle system does not yet create any particles then the Render ID of the Source object is still correct. I'm not talking about the IDs of the actual instances (that is another problem) just about the source object(s) in the scene.
Render IDs should be unique, so there should only be a single object with a Render ID of 1 in the scene. Usually the object added last to the scene happens to receive the ID=1 at render time (which is fine), so don't be confused by that when you create a test scene.
The correct IDs can be seen in a VRayRenderID channel (V-Ray VFB) and also in the G-Buffer Node Render ID channel (3ds max VFB). The IDs returned by INode::GetRenderID() do match the rendered channels except for the VRayInstancer source objects.
Example code:
Based on the SDK samples I found that this also influences various V-Ray built-in features:
I need a way to get the correct Render-ID from an INode pointer as it appears in the G-Buffer Node Render ID channel to properly extract/associate data from the G-Buffer.
Daniel
Any Source object that is used for VRayInstancer will report a Node-Render-ID of 1 (C++: INode::GetRenderID() or MAXScript: GetRenderID(node)). This only happens if the source object is actually instanced. So as long as a particle system does not yet create any particles then the Render ID of the Source object is still correct. I'm not talking about the IDs of the actual instances (that is another problem) just about the source object(s) in the scene.
Render IDs should be unique, so there should only be a single object with a Render ID of 1 in the scene. Usually the object added last to the scene happens to receive the ID=1 at render time (which is fine), so don't be confused by that when you create a test scene.
The correct IDs can be seen in a VRayRenderID channel (V-Ray VFB) and also in the G-Buffer Node Render ID channel (3ds max VFB). The IDs returned by INode::GetRenderID() do match the rendered channels except for the VRayInstancer source objects.
Example code:
Code:
-- first render scene and then execute this -- this will print all objects having an Render ID of 1 for i in geometry where GetRenderID(i) == 1 do print (i.name)
- VRayToon uses INode::GetRenderID to exclude/include objects
- VRayDirt uses INode::GetRenderID to exclude/include objects
- VRayMultiMap uses INode::GetRenderID for random by render id mode
I need a way to get the correct Render-ID from an INode pointer as it appears in the G-Buffer Node Render ID channel to properly extract/associate data from the G-Buffer.
Daniel
Comment