maybe still use the MRampAttribute is the best solutio cause I guess is more safe like class, but I would use this class also without create any attribute or outside a maya node!
On 7 Feb, 12:45, mario aquaro <[email protected]> wrote: > Hi is always me :) > regard my MRampAttribute > I would use this class just for find the inbetween value of some keys! > but I don't wanna create any ramp attribute on the node, cause I'm not > interested on give to the user the > oppurtunity of edit this key from maya, but only by my own interface! > > for that I want to know if is there a way for use this class in the > node, just for calculating and get the value, > without create the node, like this I can avoid the error that I got > everytime I open the attribute editor! > > my idea is to call this class also in my interface for edit the keys! > otherwise if you know a function for get the inbetween value, between > each keys in the list, > should be the same! > > a small example of what I need : > > if I have a list of keys like this > [{pos: 0.0, value: [-9.0, 4.0, 6.0]}, > {pos: 0.5, value: [9.0, 40.0, -16.0]}, > {pos: 1.0, value: [9.50, -14.0, 60.0]}...and so on] > > the function should do something like GetColorAtPosition of the > MRampAttribute, > means that at a specific Position (es. 0.75) the function must return > the value, maybe with linear interpolation, for keep simple! > > for still using the MRampAttribute, or a custom function is the same! > any idea? > > On 5 Feb, 20:13, mario aquaro <[email protected]> wrote: > > > Hi guys thanks for your answers > > I've already seen your posts, before, those help me a lot! > > about my specific problem I guess I just wrong using > > setPositionAtIndex, setColorAtindex and setInterpolationAtIndex > > instead of addEntries for add some key to the ramp! > > now I'm following this way, I hope is the right one! > > I'll let to you know > > thanks again > > M > > > On 4 Feb, 23:01, Chad Vernon <[email protected]> wrote: > > > > I also have some info on my site: > > > >http://www.chadvernon.com/blog/resources/maya-api-programming/mrampat... > > > > On Fri, Feb 4, 2011 at 1:09 PM, Rosenio <[email protected]> wrote: > > > > Hey Mario, > > > > > I have post about it in my blog...And here in the group you will find > > > > some stuff about it... > > > > >http://rosenio.com/blog/?p=95 > > > > > Hope it help! > > > > > On 4 fev, 18:27, mario aquaro <[email protected]> wrote: > > > > > Hi Guys, > > > > > is the first time that I write on this group > > > > > but I was a silent observer > > > > > > now I need your help, > > > > > I'm sure this is a dumb's question > > > > > but I'm not able to understand how work the MRampAttribute > > > > > > my idea is to use this class for extract the inbetween value between 2 > > > > > keys > > > > > like a remapValueNode, but with array attributes! > > > > > > in my for loop I was tring to define the MRampAttribute class: > > > > > > for k in range(keys): > > > > > myRamp = OpenMaya.MRampAttribute() > > > > > myRamp.setPositionAtIndex(position, k) > > > > > myRamp.setColorAtIndex(value, k) > > > > > myRamp.setInterpolationAtIndex(interpolation, k) > > > > > > position is a float (es. 0.0) > > > > > value is a MColor (es. MColor(0.0, 0.0, 0.0)) > > > > > interpolation is asShort() value (es.1) > > > > > > but I always got this error: > > > > > # RuntimeError: (kFailure): Unexpected Internal Failure # > > > > > > I hope someone can help me to go head! > > > > > thanks in advance > > > > > -- > > > >http://groups.google.com/group/python_inside_maya > > -- http://groups.google.com/group/python_inside_maya
