CVEI II
Sometimes the file-management part of extraction is better kept separate.
In this example, we will:
Simulate an Autodesk Maya environment
Extract some data from it
Integrate this data with a server
Without making reference to the simulated environment
Our environment.
import sys
disk = {}
server = {}
class cmds:
@staticmethod
def ls(type, assemblies):
return maya.scene.keys()
@staticmethod
def file(path, exportSelected):
disk[path] = maya.scene[maya.selected]
@staticmethod
def select(node):
maya.selected = node
class maya:
selected = None
cmds = cmds
scene = {
"john": 0xb3513451, # Binary
"door": 0x516b481f,
}
sys.modules["maya"] = mayaWe can now from maya import cmds, which we will use during collection and extraction.
Now let's integrate the data from temp on disk into our server.
Putting it all together, this is the full source code.
The key point to take away from this example is that file-management is independent of serialisation.
Last updated
Was this helpful?