Hey there  Ted. 

I'm not at my machine but I'm pretty sure its output1D[0]  output1D[1] Etc or I 
can output using output3d also. I thought it may be an issue of different data 
types going into ramp.colorEntry[0].color of the ramp which is possible I guess 
but I think I've also tried inputting nodes into the ramp that output outputRGB 
values also.  It seems that as soon as there's something going into the ramp 
that outputs into another then I can no longer read the correct color output of 
the end ramp node. Odd thing is that the Ramp node's swatch updates as does the 
surface that the material is applied to. I thought perhaps that there was a way 
to access the correct information via python api but I haven't gone down this 
route yet. 

Gerard. 

On 17/02/2013, at 6:10 AM, Ted Charlton <[email protected]> wrote:

> Hey Gerard,
> 
> What are the actual connections in and out from the plusMinusAverage node?
> 
> Cheers.
> 
> 
> On Sun, Feb 10, 2013 at 5:34 AM, Gerard v <[email protected]> wrote:
> 
> Hello. I'm pretty novice still to maya API and I am looking for a solution to 
> an issue I recently came across. Any recommendations would be greatly 
> appreciated..
> 
> The question is not entirely python based, but I suspect some of you out 
> there with great API experience may know of a potential solution.
> 
> I need to sample the colour of a texture that is the product of a number of 
> ramps, file textures etc combined using maya utility nodes. Originally all I 
> needed was a ramp controlled by an animation rig, and sampling the colour of 
> the texture at a particular U and V position was easy enough using : 
> cmds.getAttr ("combinedColourRamp.color")  or cmds.colorAtPoint.
> 
> The problem however comes when I create a resulting texture by including 
> utilities. The commands that previously worked no longer do.
> 
> Is there a way that I can pipe a resulting outColor/texture into a node that 
> can be sampled, or is there anything accessible from the API that wont fall 
> over? The colour sampling is used in an expression (hence the mel syntax). 
> Hoping someone can point me in the right direction..
> 
> Thanks
> Gerard.
> 
> 
> 
> Below is a simplified scenario: 
> B&W and RGB ramps are averaged(added.. etc) together.
> I can sample directly from 'a' and 'b'
> I can not sample the colours of the combined ramp (c)  (just gives some bogus 
> colour regardless of the UV space)
> 
> if I pass the outColor of a single ramp into another ramp (eg 'b'>'d') this 
> can be sampled
> if I pass the outColor of 'c' into 'd' sampling of 'd' fails...
> 
> I am using 2 ways to sample within an expression:
> 
> //
> 
> setAttr ("place2dTexture4.uCoord") 1.0;
> setAttr ("place2dTexture4.vCoord") .2;
> getAttr ("combinedColourRamp.color") 
> 
> and I have tried the colorAtPoint command (which I think does the exact same 
> thing...)
> 
> colorAtPoint -o RGB -u 1.0  -v 0.2 combinedColoursRamp
> 
> 
> <connections.png>
> -- 
> 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 [email protected].
> To post to this group, send email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  
> 
> -- 
> 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 [email protected].
> To post to this group, send email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
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 [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to