diff --git a/Blender/appdata_common/Blender Foundation/Blender/BLENDER_VERSION/scripts/addons/DTB/DtbOperators.py b/Blender/appdata_common/Blender Foundation/Blender/BLENDER_VERSION/scripts/addons/DTB/DtbOperators.py index b69b601b..ebdec8c8 100644 --- a/Blender/appdata_common/Blender Foundation/Blender/BLENDER_VERSION/scripts/addons/DTB/DtbOperators.py +++ b/Blender/appdata_common/Blender Foundation/Blender/BLENDER_VERSION/scripts/addons/DTB/DtbOperators.py @@ -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()