Re: [Maya-Python] Creating Attributes that can be riven by textures

2016-10-30 Thread Cedric Bazillou
In maya bible: Complete maya programming 1 and 2 there is a sample project 
doing just that.
As joe point out you can start looking to MImage class ( readFromTextureNode 

  
/ readFromFile 

 )

the other 2 class you are after are 

   - MRenderUtil::sampleShadingNetwork () 
   - MDynamicsUtil::evalDynamics2dTexture()


otherwise you can also have a mix approach have and have maya arrayMapper 
sample your image for you and let you node displace you float array 
attribute. ( look at MPxParticleAttributeMapperNode if you are interested 
 on its mechanics ).

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/0ba9f9b5-30cb-41b0-9963-192dfb473a0a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Creating Attributes that can be riven by textures

2016-10-30 Thread Joe Weidenbach
Heya,

Texture nodes as you described are more about sampling than the entire
texture. The idea is that you pass your coordinates into u and v, and then
the node returns the colour value at that point. One important distinction,
it's not a specific pixel usually. It finds the pixels surrounding those uv
values and averages them.

Hope that helps!
On Mon, 31 Oct 2016 at 12:32 AM, Dylan Smith 
wrote:

> Hi everyone,
> What would be the best way to go about creating an attribute that can be
> driven by a texture?
> After a bit of playing around with node networks in Maya, I've found that
> 'texture' attributes (such as 'outColor' from a ramp node) are recognised
> as regular *float3 *attributes instead of *float3 array* attributes
> (which is what I assume they should be). I'm not sure if this is a simple
> case of the Node Editor just telling me the wrong thing, or if its supposed
> to be some special data type. Because of this, I'm not entirely sure how to
> proceed with creating a texture attribute. For context, I want to create a
> simple displacement deformer that can have the intensity of the
> displacement controlled by a texture (be it a file or a built in generated
> texture). Any ideas for what I can do?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to python_inside_maya+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/a4f325b3-efbf-4be1-a2ff-40715c464523%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAM33%3Da47kg9KNzGFJ9ztxssVWUeEKBOW5EfJvzXb%3Dx3SWbX0ow%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] Creating Attributes that can be riven by textures

2016-10-30 Thread Dylan Smith
Hi everyone,
What would be the best way to go about creating an attribute that can be 
driven by a texture?
After a bit of playing around with node networks in Maya, I've found that 
'texture' attributes (such as 'outColor' from a ramp node) are recognised 
as regular *float3 *attributes instead of *float3 array* attributes (which 
is what I assume they should be). I'm not sure if this is a simple case of 
the Node Editor just telling me the wrong thing, or if its supposed to be 
some special data type. Because of this, I'm not entirely sure how to 
proceed with creating a texture attribute. For context, I want to create a 
simple displacement deformer that can have the intensity of the 
displacement controlled by a texture (be it a file or a built in generated 
texture). Any ideas for what I can do?

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/a4f325b3-efbf-4be1-a2ff-40715c464523%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.