noizfactory

Hey folks,

I'm trying to replace some colorAtPoint() calls in a particle expression and was trying to use textureToArray instead for texture maps (and not vertex colors which works fine). However, my textureToArray result looks different than the colorAtPoint result. My connections are:

fileTextureNode.outColor->textureToArray.inColor

meshToBeSampled.worldMesh->textureToArray.inputMesh

textureToArray.outRgbaPP->RgbaToColorAndAlpha.inRgbaPP

Then in the particle expression I'm using the result of the RgbaToColor... node in my particle attribute. I also tried plugging a pointCloudToCurve's output to textureToArray's input mesh. It still looked different. The most obvious reason would be missing u/v coordinates to sample the texture file. What do I have to plug into the textureToArray.inUCoordPP and inVCoordPP (I'm fuzzy on the exact names as I'm not in front of Maya right now).

Also, Peter, would it make sense to add a scatter point color output to the scatter node as well? Since the scatter node is already able to sample the mesh along its uvs (and hence we can use texture maps for scatter distribution), we could use the same node for color output as well instead of going through point nodes and so on. Just a thought...?


Reply 0 0
noizfactory
Hey Peter,

Sorry to bring up this old thread but I was just trying this again today and seems like there is no way to get this done without going through the polyPlane/make node or baking to vertex colors. Both methods are good but in some situations neither can be used. Is there a more direct method of passing a texture node's color info to points/particles based on the underlying mesh uv (much like inherit color option for particles or the colorAtPoint command workflow)?
Reply 0 0
pshipkov
Check the very last video on the examples page.
There is a scene for it in the archive.

Reply 0 0
noizfactory
I was trying to replicate Sergey's example but couldn't make it work for some reason. Must be some silly oversight on my part though. Will check again.
Reply 0 0
noizfactory
So I went through that example again. The particles are simply being emitted with inherit color option. However, what I'm looking for is more than that as inherit color won't work for multiple textures being piped to different pp vector attributes.
Reply 0 0
pshipkov
Check the attached file.
With SOuP we can map multiple layers of custom data to the points of given geometry object. Then with attributeTransfer nodes we can map this based on proximity to the particles. Finally we can read the outputs of the attributeTransfer nodes with particle expressions and assign the values to the particles.

Reply 0 0
noizfactory
Thank you so much Peter! I'll jump into this scene as soon as I get home :)
Reply 0 0
Frogspasm

Sorry to resurrect a very old post.

I'm trying to understand exactly how textureToArray functions.
In the example Peter posted the only node connected to it was this:

pSphereShape1.worldMesh -> a_textureToArray.inGeometry

..with no color input. But I do get values when I do a 'getAttribute a_textureToArray.outRgbaPP'.
Where do those values come from? The sphere doesn't have any vertex colors as far as I can tell.

If I plug a file texture into textureToArray.inColor with no other inputs and do the same query nothing gets returned. Why is that?

Thanks,
~Mike D.

Reply 0 0
Frogspasm
(sorry, double posted)
Reply 0 0
pshipkov
I guess you are looking at my example in the hypergraph - that's why you don't see the attached to the textureToArray procedural texture node.
Reply 0 0
Reply