So I want to create a very simple structure out of group and locator nodes in Maya which will then be exported for use in my game level.
e.g.
Group_Root
group_parent
- group1
- locator1
- group2
- locator2
- group3
There is only one Group_Root in the file, there are many group_parents ( each uniquely named ) However all group_parent s have the same three sub-group names( "group1", "group2", "group3" ) and all group1 have a locator called locator1
What I have so far is:
group_parent = c.group( em=True, name="group_parent", parent="Group_Root")
modes = ["group1", "group2", "group3"]
for mode in modes:
mode_group = c.group( em=True, n=mode, parent=group_parent )
if mode == "group1":
s = c.spaceLocator(name="locator1")
c.parent( mode_group )
elif mode == "group3":
s = c.spaceLocator(name="locator2")
c.parent( mode_group )
However I get this error at "c.parent(mode_group)"
# Error: Object group1 is invalid
Presumably because there are more than one node called "group1" so it doesn t know which one to parent.
Any idea how I do this with full paths? e.g. "Group_Root|group_parent|group1"