diff --git a/Scripts/geometry_importer.py b/Scripts/geometry_importer.py index 33503079e7a81bf4cdad388975ad92c9f4acca69..70ab9602b5e37a51c61371e366bc2eca72f2598e 100644 --- a/Scripts/geometry_importer.py +++ b/Scripts/geometry_importer.py @@ -132,11 +132,10 @@ class GeometryImporter(CustomCommand): self.set_asset_parent() # Sets the parent to the asset group, or Turntable_POS if one exists self.set_group_name() # Adds the ID to the group name + self.set_assembly_name() # Adds the ID to the assembly name # Sets the new names of the assembly and group and Reconnects any materials if self.type_ == "shot": - self.set_assembly_name() # Adds the ID to the assembly name - if self.replace: self.set_parent() # Matches the parent of the previous asset if ( @@ -459,15 +458,15 @@ class GeometryImporter(CustomCommand): if __name__ == "__main__": task = GeometryImporter() # -------------------------------------------------------------------------------------------------------------------------------------------- - task.file_path = "//studio/jobs/STU247_SaCartoon2/LIBRARIES/ASSETS/CHARACTERS/CooperA/MODELS/LOOKDEV/Main/v020/GEOMETRY_LXP/CooperA_LOOKDEV_Main_v020.lxp" - task.asset_name = "CooperA" - task.assembly_name = "CooperA_00_LOOKDEV_Main_v020" - task.object_name = "CooperA_GRP" - task.assembly_id_name = "CooperA_01_LOOKDEV_Main_v020" - task.object_id_name = "CooperA_01_GRP" + task.file_path = "//studio/jobs/INK537_Freeview/LIBRARIES/ASSETS/PROPS/ThroneA/MODELS/MODELLING/Main/v007/GEOMETRY_LXP/ThroneA_MODELLING_Main_v007.lxp" + task.asset_name = "ThroneA" + task.assembly_name = "ThroneA_00_MODELLING_Main_v007" + task.object_name = "ThroneA_GRP" + task.assembly_id_name = "ThroneA_01_MODELLING_Main_v007" + task.object_id_name = "ThroneA_01_GRP" task.uid = "01" - task.type_ = "shot" - task.item_name = "CooperA_01_ITEM" + task.type_ = "asset" + task.item_name = "ThroneA_01_ITEM" task.format = "lxp" task.parent = "assets" # "masters" "assets" "root" task.basic_Execute(None, None) diff --git a/Scripts/point_track_importer.py b/Scripts/point_track_importer.py index 109471b06bd63e93fed20a9226af8926b9564325..4ae5d31e75996507cd072e5ee68d416bcd32928f 100644 --- a/Scripts/point_track_importer.py +++ b/Scripts/point_track_importer.py @@ -96,7 +96,7 @@ class PointTrackImporter(CustomCommand): def remove_old_point_tracks(self): """Removes any old point tracks in the scene Resets mesh transforms""" - for child in self.asset_group.children(True): + for child in self.assembly.items: if child.name.split(" ")[0][-4:] == "_MSH" and child.type == "mesh": suffix = child.parent.name.split(" ")[0][-4:] if suffix == "_POS" or suffix == "_PTC": @@ -123,48 +123,6 @@ class PointTrackImporter(CustomCommand): locator.channel("isSize.Y").set("0.1") locator.channel("isSize.Z").set("0.1") - # def apply_mesh(self): - # """Applies Point Track or position from meshes""" - # for loc in self.point_track_group.children(True): - # name = loc.name.rsplit("_", 1)[0] - # for child in self.assembly.items: - # if not child.name.split(" ")[0][-4:] == "_MSH" and child.type != "mesh": - # if not child.name.split(" ")[0][-4:] == "_INS" and child.type != "meshIns": - # continue - # children = [] - # for child in self.assembly.items: - # if child.name.rsplit("_", 1)[0] == name: - # children.append(child) - # dict = {} - # for each in children: - # if each.parent not in dict.keys(): - # dict[each.parent] = [] - # dict[each.parent].append(each) - # - # if len(dict.keys()) == 1: - # parent = dict.keys()[0] - # print parent - # for child in dict[parent]: - # child.setParent(loc) - # child.channel("visible").set("default") - # loc.setParent(parent) - # elif len(dict.keys()) > 1: - # for parent in dict.keys(): - # if parent == dict.keys()[0]: - # for child in dict[parent]: - # child.setParent(loc) - # child.channel("visible").set("default") - # loc.setParent(parent) - # else: - # self.scene.select(loc) - # lx.eval("item.duplicate false locator false true") - # loc = self.scene.selected[0] - # for child in dict[parent]: - # child.setParent(loc) - # child.channel("visible").set("default") - # loc.setParent(parent) - - def apply_mesh_point_track(self): """Applies Point Track or position from meshes""" @@ -205,17 +163,17 @@ class PointTrackImporter(CustomCommand): if __name__ == "__main__": task = PointTrackImporter() - task.file_path = "//studio/jobs/INK537_Freeview/SHOTS/PR003/PR003_0100/DATA/ANIMATION/Main/v007/SpaceshipA_01_POINTTRACK/PR003_0100_ANIMATION_Main_v007.fbx" - task.asset_name = "SpaceshipA" - task.object_name = "SpaceshipA_01_GRP" - task.fbx_name = "PR003_0100_ANIMATION_Main_v007" + task.file_path = "//studio/jobs/INK000_BipTesting/SHOTS/BD001/BD001_0100/DATA/ANIMATION/PassTest/v002/BikeA_01_POINTTRACK/BD001_0100_ANIMATION_PassTest_v002.fbx" + task.asset_name = "BikeA" + task.object_name = "BikeA_01_GRP" + task.fbx_name = "BD001_0100_ANIMATION_PassTest_v002" task.type = "point_track" # "point_track" or "position" task.item_type = "mesh" # mesh or control # position or point_track #---------------------------------------------------------------------------------------- - task.file_path = "//studio/jobs/INK537_Freeview/SHOTS/PR003/PR003_0100/DATA/ANIMATION/Main/v010/SpaceshipA_01_POINTTRACK/PR003_0100_ANIMATION_Main_v010.fbx" - task.asset_name = "SpaceshipA" - task.object_name = "SpaceshipA_01_GRP" - task.fbx_name = "PR003_0100_ANIMATION_Main_v010" - task.type = "point_track" # "point_track" or "position" - task.item_type = "mesh" # "mesh" or "control" + # task.file_path = "//studio/jobs/INK537_Freeview/SHOTS/PR003/PR003_0100/DATA/ANIMATION/Main/v010/SpaceshipA_01_POINTTRACK/PR003_0100_ANIMATION_Main_v010.fbx" + # task.asset_name = "SpaceshipA" + # task.object_name = "SpaceshipA_01_GRP" + # task.fbx_name = "PR003_0100_ANIMATION_Main_v010" + # task.type = "point_track" # "point_track" or "position" + # task.item_type = "mesh" # "mesh" or "control" task.basic_Execute(None, None)