Thanks Rosenio, but that was not the issue. :)

I figured out today. So basic I shouldn't have asked.

If anyone's interested: I was passing the ArrayDataHandle directly to the
MFnDagNode, when I should've iterate over this same array's plugs to return
the correct boundingboxes for each connected mesh.



On Sat, Mar 17, 2012 at 2:18 AM, Rosenio <[email protected]> wrote:

> Sorry, I'm doing it wrong...:D
>
>
> 2012/3/16 Rosenio <[email protected]>
>
>> Hi Richard,
>>
>> Try get the values of  "bb.width()" and "bb.height()"...If I understood
>> what you want...
>>
>> Abraço!
>>
>>
>>
>> 2012/3/16 Richard Kazuo <[email protected]>
>>
>>> Hey guys,
>>>
>>> I'm working in a custom node that takes an input (MFnTypedAtribute) set
>>> to receive an array of mesh data (OpenMaya.MFnData.kMesh).
>>> In my node's *compute* method, I'm trying to access this mesh's
>>> boundingbox like this:
>>>
>>> inMeshDataHandle = dataBlock.inputArrayValue ( myNode.inputMesh )
>>>
>>> if inMeshDataHandle.elementCount():
>>>     for i in range(inMeshArrayDH.elementCount()):
>>>         inMeshDataHandle.jumpToElement( i )
>>>         oInMesh = inMeshDataHandle.inputValue().asMesh()
>>>
>>>         dagNodeFn = OpenMaya.MFnDagNode( oInMesh )
>>>         bb = dagNodeFn.boundingBox()
>>>
>>>         ...
>>>         Later on, when I print out the bb values, I always get (0, 0,
>>> 0)   :(
>>>
>>>
>>> I'm assuming my MFnDagNode pointing to a MObject (kMesh data) doesn't
>>> know how to get the transform data.
>>> So I tried to get the *dagPath* of the mesh's transform by querying the
>>> plugs on the myNode.inputMesh - the code was extensive and in the end I got
>>> the same results (0, 0, 0).
>>>
>>>
>>> Any ideas on where I'm misunderstanding something here? Is my approach
>>> wrong?
>>>
>>> Thanks in advance!
>>>
>>> --
>>> view archives: http://groups.google.com/group/python_inside_maya
>>> change your subscription settings:
>>> http://groups.google.com/group/python_inside_maya/subscribe
>>>
>>
>>
>>
>> --
>> Rosenio Pinto
>>
>>
>>
>
>
> --
> Rosenio Pinto
>
>
>  --
> view archives: http://groups.google.com/group/python_inside_maya
> change your subscription settings:
> http://groups.google.com/group/python_inside_maya/subscribe
>

-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe

Reply via email to