Message 1 of 3
Python API: Getting DAG from inputGeom mesh data

Not applicable
09-13-2020
11:11 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, i'm trying to write a collision deformer and when i try to ray cast with closestIntersection() i'm getting the error:
"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 in any way. Those methods giving me the "Object does not exist" or 'not being compatible' error.
colliderInput = dataBlock.inputValue(DirectCollision.collider).asMesh()
if colliderInput.isNull():
return
else:
thisNode = om.MFnDependencyNode(self.thisMObject())
colliderPlug = thisNode.findPlug("collider", False)
getArray = om.MPlugArray()
colliderPlug.connectedTo(getArray, True, False)
colliderNode = getArray[0].node()
colliderDAG = om.MFnDagNode(colliderNode)
colliderDagPath = om.MDagPath()
colliderDAG.getPath(colliderDagPath)
colMeshFN = om.MFnMesh(colliderDagPath)
This is how i'm getting the collider dagPath using plug but couldn't figure out a way to get the dagPath of the deforming mesh with the inputGeom data.