I made this exemple to especify what I want to do...

I try to use MScriptUtil and MFloatArray but both doesn't works...

import maya.OpenMaya as op

ligth = op.MFnVolumeLight()
ligth.create()
ligth.setLightShape(3)
myRamp = op.MRampAttribute(ligth.penumbraRamp())
myRamp.getNumEntries() #It works fine

floatA = op.MFloatArray()
floatB = op.MFloatArray()
interp = op.MRampAttribute.kLinear

floatA.append(1.0)
floatB.append(0.5)

myRamp.getValueAtPosition(floatA[0], floatB[0]) #Doesn't work
myRamp.addEntries(floatA[0], floatB[0], interp) #Doesn't work

# Error: TypeError: in method 'MRampAttribute_getValueAtPosition',
argument 3 of type 'float &' #


Somebody help me please!

Many thanks

On 4 jul, 07:13, Rosenio <[email protected]> wrote:
> Hey guys,
>
> I'm at the beginning of the study in maya python api ... and I'm
> having some trouble because I'm not familiar with the C++ Maya API.
>
> I wrote a simple scripited plugin that loads some MRampAtribute
> objects, it works ok so far. But I am not able to understand how to
> use some functions like 'getNumEntries', 'addEntries',
> 'getValueAtPosition' ... etc... There is a C++ exemple in devkit
> directory(volumeLigthCmd.cpp). But this is a bit difficult for me to
> transcribe for python.
>
> If helps, I put the code of node in my blognotes here...
>
> http://rosenio.com/blog/?p=88
>
> So, how can I put it in a compute function and call the functions like
> 'getNumEntries' or 'getValueAtPosition'?
>
> I know I'm taking a step bigger than my leg ... but would be happy if
> someone can help me.
>
> Excuse me for beginner's ask and bad english ...
>
> Many thanks!

-- 
http://groups.google.com/group/python_inside_maya

Reply via email to