parameters: (self, plug, block)
docstring: Compute output force.
docstring_summary: Compute output force.
docstring_tokens: Compute output force .
function: def compute(self, plug, block):
  		"""
  		Compute output force.
  		"""
  		outputForce = OpenMayaMPx.cvar.MPxFieldNode_mOutputForce
  		if not (plug == outputForce):
  			return
  
  		# get the logical index of the element this plug refers to.
  		#
  		try:
  			multiIndex = plug.logicalIndex()
  		except:
  			statusError("ERROR in plug.logicalIndex.")
  
  		# Get input data handle, use outputArrayValue since we do not
  		# want to evaluate both inputs, only the one related to the
  		# requested multiIndex. Evaluating both inputs at once would cause
  		# a dependency graph loop.
  		#
  		inputData = OpenMayaMPx.cvar.MPxFieldNode_mInputData
  		try:
  			hInputArray = block.outputArrayValue(inputData)
  		except:
  			statusError("ERROR in hInputArray = block.outputArrayValue().")
  
  		try:
  			hInputArray.jumpToElement(multiIndex)
  		except:
  			statusError("ERROR: hInputArray.jumpToElement failed.")
  
  		# get children of aInputData.
  		#
  		try:
  			hCompond = hInputArray.inputValue()
  		except:
  			statusError("ERROR in hCompond=hInputArray.inputValue")
  
  		inputPositions = OpenMayaMPx.cvar.MPxFieldNode_mInputPositions
  		hPosition = hCompond.child(inputPositions)
  		dPosition = hPosition.data()
  		fnPosition = OpenMaya.MFnVectorArrayData(dPosition)
  		try:
  			points = fnPosition.array()
  		except:
  			statusError("ERROR in fnPosition.array(), not find points.")
  
  		inputVelocities = OpenMayaMPx.cvar.MPxFieldNode_mInputVelocities
  		hVelocity = hCompond.child(inputVelocities)
  		dVelocity = hVelocity.data()
  		fnVelocity = OpenMaya.MFnVectorArrayData(dVelocity)
  		try:
  			velocities = fnVelocity.array()
  		except:
  			statusError("ERROR in fnVelocity.array(), not find velocities.")
  
  		inputMass = OpenMayaMPx.cvar.MPxFieldNode_mInputMass
  		hMass = hCompond.child(inputMass)
  		dMass = hMass.data()
  		fnMass = OpenMaya.MFnDoubleArrayData(dMass)
  		try:
  			masses = fnMass.array()
  		except:
  			statusError("ERROR in fnMass.array(), not find masses.")
  
  		# Compute the output force.
  		#
  		forceArray = OpenMaya.MVectorArray()
  		useMaxDistSet = self.__useMaxDistanceValue(block)
  		if useMaxDistSet:
  			self.__applyMaxDist(block, points, velocities, masses, forceArray)
  		else:
  			self.__applyNoMaxDist(block, points, velocities, masses, forceArray)
  
  		# get output data handle
  		#
  		try:
  			hOutArray = block.outputArrayValue(outputForce)
  		except:
  			statusError("ERROR in hOutArray = block.outputArrayValue.")
  		try:
  			bOutArray = hOutArray.builder()
  		except:
  			statusError("ERROR in bOutArray = hOutArray.builder.")
  
  		# get output force array from block.
  		#
  		try:
  			hOut = bOutArray.addElement(multiIndex)
  		except:
  			statusError("ERROR in hOut = bOutArray.addElement.")
  
  		fnOutputForce = OpenMaya.MFnVectorArrayData()
  		try:
  			dOutputForce = fnOutputForce.create(forceArray)
  		except:
  			statusError("ERROR in dOutputForce = fnOutputForce.create")
  
  		# update data block with new output force data.
  		#
  		hOut.setMObject(dOutputForce)
  		block.setClean(plug)
function_tokens: def compute ( self , plug , block ) : outputForce = OpenMayaMPx . cvar . MPxFieldNode_mOutputForce if not ( plug == outputForce ) : return # get the logical index of the element this plug refers to. # try : multiIndex = plug . logicalIndex ( ) except : statusError ( "ERROR in plug.logicalIndex." ) # Get input data handle, use outputArrayValue since we do not # want to evaluate both inputs, only the one related to the # requested multiIndex. Evaluating both inputs at once would cause # a dependency graph loop. # inputData = OpenMayaMPx . cvar . MPxFieldNode_mInputData try : hInputArray = block . outputArrayValue ( inputData ) except : statusError ( "ERROR in hInputArray = block.outputArrayValue()." ) try : hInputArray . jumpToElement ( multiIndex ) except : statusError ( "ERROR: hInputArray.jumpToElement failed." ) # get children of aInputData. # try : hCompond = hInputArray . inputValue ( ) except : statusError ( "ERROR in hCompond=hInputArray.inputValue" ) inputPositions = OpenMayaMPx . cvar . MPxFieldNode_mInputPositions hPosition = hCompond . child ( inputPositions ) dPosition = hPosition . data ( ) fnPosition = OpenMaya . MFnVectorArrayData ( dPosition ) try : points = fnPosition . array ( ) except : statusError ( "ERROR in fnPosition.array(), not find points." ) inputVelocities = OpenMayaMPx . cvar . MPxFieldNode_mInputVelocities hVelocity = hCompond . child ( inputVelocities ) dVelocity = hVelocity . data ( ) fnVelocity = OpenMaya . MFnVectorArrayData ( dVelocity ) try : velocities = fnVelocity . array ( ) except : statusError ( "ERROR in fnVelocity.array(), not find velocities." ) inputMass = OpenMayaMPx . cvar . MPxFieldNode_mInputMass hMass = hCompond . child ( inputMass ) dMass = hMass . data ( ) fnMass = OpenMaya . MFnDoubleArrayData ( dMass ) try : masses = fnMass . array ( ) except : statusError ( "ERROR in fnMass.array(), not find masses." ) # Compute the output force. # forceArray = OpenMaya . MVectorArray ( ) useMaxDistSet = self . __useMaxDistanceValue ( block ) if useMaxDistSet : self . __applyMaxDist ( block , points , velocities , masses , forceArray ) else : self . __applyNoMaxDist ( block , points , velocities , masses , forceArray ) # get output data handle # try : hOutArray = block . outputArrayValue ( outputForce ) except : statusError ( "ERROR in hOutArray = block.outputArrayValue." ) try : bOutArray = hOutArray . builder ( ) except : statusError ( "ERROR in bOutArray = hOutArray.builder." ) # get output force array from block. # try : hOut = bOutArray . addElement ( multiIndex ) except : statusError ( "ERROR in hOut = bOutArray.addElement." ) fnOutputForce = OpenMaya . MFnVectorArrayData ( ) try : dOutputForce = fnOutputForce . create ( forceArray ) except : statusError ( "ERROR in dOutputForce = fnOutputForce.create" ) # update data block with new output force data. # hOut . setMObject ( dOutputForce ) block . setClean ( plug )