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 e1ede6c
Showing 1 changed file with 11 additions and 0 deletions.
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

0 comments on commit e1ede6c

Please sign in to comment.