Skip to content

Commit

Permalink
Allow toRigify after loading
Browse files Browse the repository at this point in the history
  • Loading branch information
UuuNyaa committed Nov 7, 2022
1 parent 6360d6f commit 8b9ff60
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,20 @@ def invoke(self, context, event):
return context.window_manager.invoke_confirm(self, event)
return self.execute(context)

@classmethod
def poll(cls, context):
return Global.amIAmtr(context.object)

def execute(self, context):
clear_pose()
Util.active_object_to_current_collection()
if Global.getHomeTown() == "":
collection = context.object.get('Collection', '0')
home_town = os.path.join(Global.getRootPath(), "FIG", "FIG" + collection[-1])
if not os.path.exists(home_town):
self.report({"ERROR"}, "Daz figure is not selected")
return {"CANCELLED"}
Global.setHomeTown(home_town)
dtu = DataBase.DtuLoader()
trf = ToRigify.ToRigify(dtu)
db = DataBase.DB()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def toRigify(self, db, main):
return
Global.convert_vgroups() # Updates VertexGroups
if len(Global.get_bone_limit()) == 0: # Seems not Necessary
Global.bone_limit_modify()
Global.bone_limit_modify(self.dtu.get_bone_limits_dict())
wm.progress_update(5)
dobj = Global.getAmtr()
Versions.select(dobj, True)
Expand Down

0 comments on commit 8b9ff60

Please sign in to comment.