getAPathTo method gives " Object is incompatible with this method" error. I was dealing with this for like 4 days, just after i posted here your idea came to my mind. I'll try that tomorrow, i think it's just multiplication of the MPoint and localToWorldMatrix, is that correct?
14 Eylül 2020 Pazartesi tarihinde saat 17:00:52 UTC+3 itibarıyla vince touache şunları yazdı: > hello, > > not sure my approach is the right one, but I usually try to avoid working > with full dag paths in a deformer, as I prefer to keep every node > independent from the others (beside inputs connections ofc). > If you want to get the dag path, you can use the static method > MDagPath::getAPathTo(). > But instead of doing that, couldn't you use the localToWorldMatrix > provided to you by Maya in the deform() method? It will require a little > bit more math, but give a more robust result to get your world position > > Le lundi 14 septembre 2020 à 08:49:52 UTC-4, [email protected] a écrit : > >> Hi, i'm trying to write a collision deformer and when i try to ray cast >> with MFnMesh.closestIntersection() i'm getting the error below because i >> need the points in worldSpace: >> >> "Must have a DAG path to do world space transforms #" >> inputGet = ommpx.cvar.MPxGeometryFilter_input >> inputHandle = dataBlock.outputArrayValue(inputGet) >> inputHandle.jumpToElement(geoIndex) >> inputElement = inputHandle.outputValue() >> inputGeomGet = ommpx.cvar.MPxGeometryFilter_inputGeom >> inputGeom = inputElement.child(inputGeomGet).asMesh() >> defMeshFN = om.MFnMesh(inputGeom) >> >> I'm not getting any error with this, i can attach a function set to >> inputGeom but i can't use the dagPath or getPath methods. Those methods >> giving me the "Object does not exist" or 'not being compatible' error. >> >> I can get the collider dagPath using MPlug because it's a custom >> attribute on the node. I tried the same with outputGeom plug and some >> GeometryFilter methods but they result in cycle. It's frustrating, any help >> is highly appreciated! >> > -- 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 email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/5137c960-ef14-4b9d-ba1a-c9456bc90e0en%40googlegroups.com.
