Hi all,

i was wanting to make my own Node that stored Vertex Offset data sorta in the 
same structure as a PolyTweak node does. but i want to feed it the offset data.

so that i can just acumulate offsets by creating more DeformerNodes and 
assigning offset data.

my question is is what data Type am i looking for to do this. i'm fairly new to 
API and at the moment all i have done is used it to get and set data note 
create my own node and set its data. Yet!!


i have been looking at the ytwistNode example in the Maya Help(example below).

i think all i need to know is get the right DataStorage in the
while geomIter.isDone() == False:

but what is the data block i should be looking for? is there a section on 
setting and storing data to a node?

any help would be great.

john


class yTwistNode(OpenMayaMPx.MPxDeformerNode):
       # class variables
       angle = OpenMaya.MObject()
       # constructor
       def __init__(self):
               OpenMayaMPx.MPxDeformerNode.__init__(self)
       # deform
       def deform(self,dataBlock,geomIter,matrix,multiIndex):
               #
               # get the angle from the datablock
               angleHandle = dataBlock.inputValue( self.angle )
               angleValue = angleHandle.asDouble()
               #
               # get the envelope
               envelope = OpenMayaMPx.cvar.MPxDeformerNode_envelope
               envelopeHandle = dataBlock.inputValue( envelope )
               envelopeValue = envelopeHandle.asFloat()
               #
               # iterate over the object and change the angle
               while geomIter.isDone() == False:
                       point = geomIter.position()
                       ff = angleValue * point.y * envelopeValue
                       if ff != 0.0:
                               cct= math.cos(ff)
                               cst= math.sin(ff)
                               tt= point.x*cct-point.z*cst
                               point.z= point.x*cst + point.z*cct
                               point.x=tt
                       geomIter.setPosition( point )
                       geomIter.next()
--
http://groups.google.com/group/python_inside_maya

Reply via email to