Skip to content

Commit

Permalink
WIP file reference support for maya ascii
Browse files Browse the repository at this point in the history
  • Loading branch information
agibli committed Jun 2, 2015
1 parent 6e82f82 commit d4a533c
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions maya/ascii.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def __init__(self):
self.__command_handlers = {
"requires": self._exec_requires,
"fileInfo": self._exec_file_info,
"file": self._exec_file,
"createNode": self._exec_create_node,
"setAttr": self._exec_set_attr,
}
Expand Down Expand Up @@ -37,6 +38,38 @@ def _exec_requires(self, args):
def _exec_file_info(self, args):
self.on_file_info(args[0], args[1])

def _exec_file(self, args):
reference = False
reference_depth_info = None
namespace = None
defer_reference = False
reference_node = None

argptr = 0
while argptr < len(args):
arg = args[argptr]
if arg in ("-r", "--reference"):
reference = True
argptr += 1
elif arg in ("-rdi", "--referenceDepthInfo"):
reference_depth_info = int(args[argptr + 1])
argptr += 2
elif arg in ("-ns", "--namespace"):
namespace = args[argptr + 1]
argptr += 2
elif arg in ("-dr", "--deferReference"):
defer_reference = bool(int(args[argptr + 1]))
argptr += 2
elif arg in ("-rfn", "--referenceNode"):
reference_node = args[argptr + 1]
argptr += 2
else:
break

if argptr < len(args):
path = args[argptr]
self.on_file_reference(path)

def _exec_create_node(self, args):
nodetype = args[0]

Expand Down

0 comments on commit d4a533c

Please sign in to comment.