MCPcopy Create free account
hub / github.com/ImageEngine/cortex / transform

Method transform

contrib/scripts/9to10/fix_modules.py:62–101  ·  view source on GitHub ↗
( self, node, results )

Source from the content-addressed store, hash-verified

60 self.__haveSceneImport = False
61
62 def transform( self, node, results ) :
63
64 if "coreImport" in results and node.depth() == 1 :
65
66 self.__coreImport = results["coreImport"]
67
68 elif "imathImport" in results and node.depth() == 1 :
69
70 self.__haveImathImport = True
71
72 elif "sceneImport" in results and node.depth() == 1 :
73
74 self.__haveSceneImport = True
75
76 elif "name" in results and hasattr( IECoreScene, results["name"].value ) :
77
78 if results["name"].value == "TypeId" :
79 attr = None
80 if results["remainder"] :
81 attr = str( results["remainder"][0] ).lstrip( "." )
82 if not attr or not attr[0].isupper() or not hasattr( IECoreScene.TypeId, attr ) :
83 # Not an IECoreScene TypeId, so no transformation
84 # is needed.
85 return
86
87 results["module"].value = "IECoreScene"
88 node.changed()
89
90 if not self.__haveSceneImport :
91 self.__insertImport( "IECoreScene", 1 )
92 self.__haveSceneImport = True
93
94 elif "name" in results and hasattr( imath, results["name"].value ) :
95
96 results["module"].value = "imath"
97 node.changed()
98
99 if not self.__haveImathImport :
100 self.__insertImport( "imath", 0 )
101 self.__haveImathImport = True
102
103 def __insertImport( self, module, offset ) :
104

Callers 5

writeTransformMethod · 0.45
dataToMatrixMethod · 0.45
readTransformAsMatrixMethod · 0.45
worldBoundFunction · 0.45
operator()Method · 0.45

Calls 2

__insertImportMethod · 0.95
strFunction · 0.50

Tested by

no test coverage detected