Re: [Maya-Python] getting bounding box of object in object space

2018-12-04 Thread Michael Boon
(Marcus: I thought axis-aligned bounding box specifically meant world-space axis aligned. AABBs are used for culling so all AABBs need to be in the same space.) The xform command has switches that should do what you want: *-boundingBox*(*-bb*) [image: query] Returns the bounding box of an

[Maya-Python] Re: [NurbsCurve] Alogrithm create curve from joints

2018-12-04 Thread Rémi Deletrain
Hi everyone, Thanks for your reply ! I have not had time to look since my last post. I try to look this week -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from

Re: [Maya-Python] Can't read worldMatrix of custom Python API 2.0 node

2018-12-04 Thread Tim Fowler
Not sure what you're hitting. That last line gives me... om.MFnMatrixData(plug.asMObject()).matrix() # Result: maya.api.OpenMaya.MMatrix(((1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1))) # On Tue, Dec 4, 2018 at 1:33 AM Marcus Ottosson wrote: > Hi all, > I’ve been writing custom nodes

Re: [Maya-Python] Can't read worldMatrix of custom Python API 2.0 node

2018-12-04 Thread Marcus Ottosson
Wuw! What version of Maya is that, and what OS? I'm on Windows, Maya 2018. Hadn't considered it might be a version or OS thing, will have a look at that. On Tue, 4 Dec 2018 at 14:14, Tim Fowler wrote: > Not sure what you're hitting. That last line gives me... > >

Re: [Maya-Python] Can't read worldMatrix of custom Python API 2.0 node

2018-12-04 Thread Tim Fowler
Hmm...looks like I tried that on an unreleased version of Maya (and a Debug version too). Just tried again in Maya 2018 and got the same error as you. I'll take a quick look and see if I can figure out what fixed it, but I should warn you that API fixes can sometimes be tricky to get into

Re: [Maya-Python] getting bounding box of object in object space

2018-12-04 Thread James Kim
I tried using xform before but it still gives me the same problem where rotating the object gives me different values. Perhaps there is another way of getting the size of an object? I want something like the tool you get when you press ctrl+t which shows the size of any selected object. On

Re: [Maya-Python] Can't read worldMatrix of custom Python API 2.0 node

2018-12-04 Thread Michael Boon
Can you use fn.dagPath().inclusiveMatrix() ? On Wednesday, 5 December 2018 02:02:25 UTC+11, Marcus Ottosson wrote: > > Mm, I'm looking to get a matrix out of Maya 2015 and above, so a patch > would unfortunately not help me in this case. Do you know of another way of > getting hold of that

Re: [Maya-Python] getting bounding box of object in object space

2018-12-04 Thread Michael Boon
Using OpenMaya you can get the object-space bounding box of a MFnDagNode. PyMel exposes that function, which might be the easiest way to get it. something like this (untested!) import pymel.core as pm obj = cmds.ls(sl=True)[0] pymelObj = pm.PyNode(obj) # Alternatively you could just do pymelObj

Re: [Maya-Python] getting bounding box of object in object space

2018-12-04 Thread James Kim
Thanks but its still giving me the same result. I'm looking into using the api right now > > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an

Re: [Maya-Python] getting bounding box of object in object space

2018-12-04 Thread Michael Boon
Ah, you need to select the shape node. If you call boundingBox on the transform, you get world space (or something, not local space anyhow) On Wednesday, 5 December 2018 09:33:58 UTC+11, James Kim wrote: > > Thanks but its still giving me the same result. I'm looking into using the > api right