deluxmilkman

I would like to plug particle's rgbPP and opacity PP into attributeTransfer node,

but attributeTransfer node only has inRgba input. 


Is there a node that is reverse of RgbaToColorAndAlpha?


How can I do this?


Alternatively, can I use arrayToDynArrays node with rgbPP and opacityPP even though color and opacity are not listed under Quick Help - Local Variables?

Reply 0 0
pshipkov
you can, but if your intention is to feed them into instancer node as colors and alphas that wont work because the instancer does not support that kind of stuff.

i cannot remember anymore but there is a chance the attributetransfer to recognize rgb and rgba arrays. i dont have maya infront of me to verify that right now, but try to transfer them independently as rgb and weight, etc.
Reply 0 0
deluxmilkman
Thank you for your replay. I'm trying to feed them into a shader assigned onto my instanced geometry using rendermanCode node, which works fine without SOuP.

but when i connect SOuP node,  rendermaCode seems unable to pick up rgbPP nor opacityPP. Do you have any idea why this is happening?
Reply 0 0
pshipkov
Probably because it is hardcoded to work with just particles.
You can try to bake that info into array attributes and then read that from within your shader and map it to the particle instances.

Will take a look at your scene later but i don't have PRMan at home :)

Reply 0 0
noizfactory

If you are using rendermanCode node (which, btw, is a part of 3delight, Peter and the pro version is also free to download from their website) then you don't need to use the attributeTransfer node to pass rgbPP or opaciyPP to the instanced object's shader.

Instead you can pick it from the rib as primvars and use the same in your shading code. You might be already passing them as primvars if you added the 3delight geometry attribute node and checked the options under particles. In the code node's input section, specify them as input color rgbPP and input color opacityPP. Check the scene rib. If rgbPP goes in as a "user" attribute instead of a primvar then you will simply need to query in this manner:

color prtCol;color prtOpc;attribute("user:rgbPP", prtCol);attribute("user:opacityPP",   prtOpc  );outColor = prtCol;outOpacity = prtOpc  ;

Reply 0 0
deluxmilkman
Thanks for your replay.
That's exactly what i have on my rendermanCode, and it works when I connect nParticleShape to instancer directly (pictured below).

but it stops working when i add SOuP nodes in-between. 

i think some attributes are getting lost on instancer. i don't know how to reconnect them.
Reply 0 0
pshipkov
I am not very familiar with 3Delight, so there might be a simpler way to achieve that.

Reply 0 0
noizfactory
Pass me a simple example scene file deluxemilkman. I'll give it a spin.
Reply 0 0
deluxmilkman
here are the files as posted above.
one is with SOuP and the other without.
thanks.
Reply 0 0
noizfactory

Ok I see what you are trying to do (your files won't open at my end since I'm using 32 bit and an older Maya version currently). The problem is that the rib exporter, by default, is wired to export the rgbPP, etc. data into the rib only when the instancer node is directly using particles for its inputs. Since you are using the soup array nodes instead, the rib exporter won't know that it has to export the per particle attributes for the instanced objects.

For this kind of setup I either use particles purely for instancing alone or just export the instancer data from soup into the ribs myself through a custom script. In the former method I pass all the attribute transfer or point node stuff or any soup info to the particle by creating per particle array attributes and filling them with soup array outputs. And then you can add a 3delight geometry attribute to the particle and make sure that the pp attributes that you want to export into the rib are listed in the outputs.

Here is an example where the mesh normal is being piped through an attributeTransfer into the particle as its rgbPP and at the same time as a vectorPP attribute called normalPP which is being used in the particle instancer for aimDirection :

I have attached a Maya 2009 32 bit scene which will hopefully open correctly at your end and help illustrate the above.
Reply 0 0
pshipkov
Thanks for the info noizfactory !
Reply 0 0
noizfactory
Just forgot to mention that the point radius in the bounding volume node acts as sort of a normals blend factor for both the instancer as well as the shader. Hence in the previous image the instanced objects' rendered color is not exactly like the normals display snapshot. I was using a high point radius value of 30 in the bounding object node. I set it back to 1 and this is what I get.


soup_attributeTransfer_Instancer.jpg
Reply 0 0
deluxmilkman
great info. thanks alot.
Reply 0 0
Reply