daily pastebin goal
56%
SHARE
TWEET

Untitled

a guest Oct 11th, 2018 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import maya.api.OpenMaya as om
  2. class AbsoluteNode(str):
  3.     def __init__(self, node):
  4.         self.node = node
  5.         self.MObject = MObjectFrom(self.node)
  6.         self.MDagPath = om.MDagPath.getAPathTo(self.MObject)
  7.         return self.node
  8.        
  9.     def __repr__(self):
  10.         self.refreshPath()
  11.         return self.node
  12.  
  13.     def refreshPath(self):
  14.         self.MDagPath = om.MDagPath.getAPathTo(self.mObject)
  15.         self.node = self.MDagPath.fullPathName()
  16.  
  17. """ example implementation:
  18. def createAbsoluteNode(*args, **kwargs):
  19.   return AbsoluteNode(cmds.createNode(args, kwargs))
  20.  
  21. any dag node passed will keep a valid reference to itself, regardless of hierarchy changes
  22. basically just parent away
  23. """
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top