Hi Peter,

I have utilized this feature directly in Maya Python.
and I am able to find out whether two objects colliding or not.
Except for polyCubes, It is working for all other objects and complicated
shapes also
Some times it is working for polyCubes also.

we have to use:

xform (firstObj, q=1, ws=1,  bb=1) -------> It yields 6 digits -------->
[f_minX, f_minY, f_minZ, f_maxX, f_maxY, f_maxZ]           # bb yields
bounding box information
xform (secondObj, q=1, ws=1, bb=1) -------> It yields 6 digits -------->
[s_minX, s_minY, s_minZ, s_maxX, s_maxY, s_maxZ]

collideCheck =[]

for fx in range(f_minX, f_maxX):
    if (fx> s_minX) and (fx<s_maxX):
       collideCheck.append(True)
       break

--do-- for yRange

--do-- for zRange

if collideCheck == [True, True, True]
   print 'Objects are colliding'
else:
   print 'Not colliding'

Try this..

Subbu


On Thu, Jan 21, 2010 at 5:50 AM, Chad Dombrova <[email protected]> wrote:

> we've fixed a few bugs with api wrappers in 1.0. you might want to check
> out the current rc1 release on our downloads page.
>
> -chad
>
>
>
> On Wed, Jan 20, 2010 at 3:23 PM, pjrich <[email protected]> wrote:
>
>> I'm implementing a collision detection scheme in Maya 2009 with PyMEL
>> 0.9.2 which makes extensive use of getBoundingBox(). I'm running into
>> some weirdness -- occasionally instead of returning a min and a max,
>> getBoundingBox() returns two points which are both the average of the
>> real min and max.
>>
>> So instead of:
>> [(1, 1, 1), (2, 2, 2)]
>> I'll get:
>> [(1.5, 1.5, 1.5), (1.5, 1.5, 1.5)]
>>
>> Sometimes this will cause getBoundingBox().intersects() to erroneously
>> return False. When this happens and an intersection is missed, if I
>> run a manual check, the bounding box comes back properly.
>>
>> This doesn't happen consistently, only after quite a few iterations,
>> and only on objects I've just created. I'm only working with polyCubes
>> at the moment.
>>
>> Has anyone else ever run into this? I don't see it in the issues list,
>> did I find a bug?
>>
>> - Peter
>>
>> --
>> http://groups.google.com/group/python_inside_maya
>>
>
>  --
> http://groups.google.com/group/python_inside_maya
-- 
http://groups.google.com/group/python_inside_maya

Reply via email to