class MPFB_PT_From_Presets_Panel(Abstract_Panel): """Create human from preset main panel.""" bl_label = "From presets" bl_space_type = "VIEW_3D" bl_region_type = "UI" bl_category = UiService.get_value("MODELCATEGORY") bl_options = {'DEFAULT_CLOSED'} bl_parent_id = "MPFB_PT_New_Panel" def _create(self, scene, layout): PRESETS_HUMAN_PROPERTIES.draw_properties(scene, layout, [ "available_presets", "scale_factor", "detailed_helpers", "extra_vertex_groups", "mask_helpers" ]) layout.operator('mpfb.human_from_presets') def draw(self, context): _LOG.enter() layout = self.layout scene = context.scene self._create(scene, layout)
class MPFB_PT_Human_Presets_Panel(Abstract_Panel): bl_label = "Human presets" bl_category = UiService.get_value("MATERIALSCATEGORY") bl_options = {'DEFAULT_CLOSED'} bl_parent_id = "MPFB_PT_Presets_Panel" def _load_save_box(self, scene, layout): _LOG.enter() HUMAN_PRESETS_PROPERTIES.draw_properties(scene, layout, ["available_presets"]) layout.operator('mpfb.overwrite_human_presets') HUMAN_PRESETS_PROPERTIES.draw_properties(scene, layout, ["name"]) layout.operator('mpfb.save_new_human_presets') def draw(self, context): _LOG.enter() layout = self.layout scene = context.scene self._load_save_box(scene, self._create_box(layout, "Load/save presets", "MODIFIER")) @classmethod def poll(cls, context): obj = context.active_object if not obj: return False if ObjectService.object_is_basemesh_or_body_proxy(obj): return True if ObjectService.object_is_skeleton(obj): return True return False
class MPFB_PT_Add_Rig_Panel(Abstract_Panel): """Functionality for adding/setting rig""" bl_label = "Add rig" bl_category = UiService.get_value("MODELCATEGORY") bl_parent_id = "MPFB_PT_Rig_Panel" def _standard_rig(self, scene, layout): box = self.create_box(layout, "Add standard rig") props = ["standard_rig", "import_weights"] ADD_RIG_PROPERTIES.draw_properties(scene, box, props) box.operator('mpfb.add_standard_rig') def _rigify_rig(self, scene, layout): box = self.create_box(layout, "Add rigify rig") props = ["import_weights_rigify", "delete_after_generate", "generate"] ADD_RIG_PROPERTIES.draw_properties(scene, box, props) box.operator('mpfb.add_rigify_rig') box.operator('mpfb.generate_rigify_rig') def draw(self, context): _LOG.enter() layout = self.layout scene = context.scene self._standard_rig(scene, layout) self._rigify_rig(scene, layout)
class MPFB_PT_Web_Resources_Panel(Abstract_Panel): """UI for opening web links.""" bl_label = "Web resources" bl_category = UiService.get_value("DEVELOPERCATEGORY") bl_options = {'DEFAULT_CLOSED'} bl_parent_id = "MPFB_PT_System_Panel" def _url(self, layout, label, url): weblink = layout.operator("mpfb.web_resource", text=label) weblink.url = url def draw(self, context): _LOG.enter() layout = self.layout self._url(layout, "Project home", "https://github.com/makehumancommunity/mpfb2") self._url( layout, "Documentation", "https://github.com/makehumancommunity/mpfb2/blob/master/docs/README.md" ) self._url(layout, "Get support", "http://www.makehumancommunity.org/forum/") self._url(layout, "Report a bug", "https://github.com/makehumancommunity/mpfb2/issues") self._url( layout, "Asset packs", "http://download.tuxfamily.org/makehuman/asset_packs/index.html")
class MPFB_PT_MakeClothes_Panel(Abstract_Panel): """MakeClothes main panel.""" bl_label = "MakeClothes" bl_category = UiService.get_value("CLOTHESCATEGORY") bl_options = {'DEFAULT_CLOSED'} bl_parent_id = "MPFB_PT_Create_Panel" def _setup_clothes(self, scene, layout): box = self._create_box(layout, "Set up clothes", "TOOL_SETTINGS") box.operator('mpfb.extract_makeclothes_clothes') box.operator('mpfb.mark_makeclothes_clothes') def _write_clothes(self, blender_object, scene, layout): box = self._create_box(layout, "Write clothes", "MATERIAL_DATA") props = ["overwrite"] MAKECLOTHES_PROPERTIES.draw_properties(scene, box, props) props = ["name", "description", "tag", "license", "author", "homepage"] MakeClothesObjectProperties.draw_properties(blender_object, box, props) box.operator('mpfb.write_makeclothes_clothes') def draw(self, context): _LOG.enter() layout = self.layout scene = context.scene blender_object = context.active_object #self._setup_clothes(scene, layout) if blender_object is None: return
class MPFB_PT_Importer_Panel(Abstract_Panel): bl_label = "From MakeHuman" bl_category = UiService.get_value("IMPORTERCATEGORY") bl_options = {'DEFAULT_CLOSED'} bl_parent_id = "MPFB_PT_New_Panel" def draw(self, context): _LOG.enter() layout = self.layout scn = context.scene from mpfb.ui.eyesettings.eyesettingspanel import ensure_eye_settings_default_exists ensure_eye_settings_default_exists() if UiService.get_importer_panel_list() is None: UiService.rebuild_importer_panel_list() if UiService.get_importer_enhanced_settings_panel_list() is None: UiService.rebuild_importer_enhanced_settings_panel_list() if UiService.get_importer_eye_settings_panel_list() is None: UiService.rebuild_importer_eye_settings_panel_list() IMPORTER_PROPERTIES.draw_properties(scn, layout, [ "presets_for_import", "skin_settings_for_import", "eye_settings_for_import" ]) layout.operator('mpfb.importer_import_body')
class MPFB_PT_New_Panel(Abstract_Panel): bl_label = "New human" bl_category = UiService.get_value("MODELCATEGORY") def draw(self, context): _LOG.enter() layout = self.layout scn = context.scene
class MPFB_PT_Materials_Panel(Abstract_Panel): bl_label = "Materials" bl_category = UiService.get_value("MATERIALSCATEGORY") def draw(self, context): _LOG.enter() layout = self.layout scn = context.scene
class MPFB_PT_System_Panel(Abstract_Panel): bl_label = "System and resources" bl_category = UiService.get_value("DEVELOPERCATEGORY") def draw(self, context): _LOG.enter() layout = self.layout scn = context.scene
class MPFB_PT_Developer_Panel(bpy.types.Panel): """UI for various developer functions.""" bl_label = "Developer" bl_space_type = "VIEW_3D" bl_region_type = "UI" bl_category = UiService.get_value("DEVELOPERCATEGORY") bl_options = {'DEFAULT_CLOSED'} def _create_box(self, layout, box_text): _LOG.enter() box = layout.box() box.label(text=box_text) return box def _log_levels(self, scene, layout): box = self._create_box(layout, "Log levels") box.operator("mpfb.list_log_levels") box.operator("mpfb.reset_log_levels") LOG_LEVELS_PROPERTIES.draw_properties( scene, box, ["available_loggers", "chosen_level"]) box.operator("mpfb.set_log_level") def _export_log_file(self, scene, layout): box = self._create_box(layout, "Export log file") box.label(text="Use default for combined log") LOG_LEVELS_PROPERTIES.draw_properties(scene, box, ["available_loggers"]) box.operator("mpfb.export_log") def _nodes(self, layout): box = self._create_box(layout, "Load/save nodes") box.operator("mpfb.save_nodes") box.operator("mpfb.load_nodes") def _rig(self, layout): box = self._create_box(layout, "Load/Save rig") box.operator("mpfb.load_rig") box.operator("mpfb.save_rig") box.operator("mpfb.load_rigify_layers") box.operator("mpfb.save_rigify_layers") def _weights(self, layout): box = self._create_box(layout, "Load/Save weights") #box.operator("mpfb.load_rig") box.operator("mpfb.save_weights") def draw(self, context): _LOG.enter() layout = self.layout scene = context.scene self._log_levels(scene, layout) self._export_log_file(scene, layout) self._nodes(layout) self._rig(layout) self._weights(layout)
class MPFB_PT_Enhanced_Settings_Panel(Abstract_Panel): bl_label = "Skin material presets" bl_category = UiService.get_value("MATERIALSCATEGORY") bl_options = {'DEFAULT_CLOSED'} bl_parent_id = "MPFB_PT_Presets_Panel" def _load_save_box(self, scene, layout): _LOG.enter() ENHANCED_SETTINGS_PROPERTIES.draw_properties(scene, layout, ["available_settings"]) layout.operator('mpfb.enhancedsettings_apply_settings') layout.operator('mpfb.overwrite_enhanced_settings') ENHANCED_SETTINGS_PROPERTIES.draw_properties(scene, layout, ["name"]) layout.operator('mpfb.save_new_enhanced_settings') def draw(self, context): _LOG.enter() # TODO: this section should probably also be present in the importer panel default_json = LocationService.get_user_config( "enhanced_settings.default.json") if not os.path.exists(default_json): _LOG.warn( "The default enhanced settings do not exist. Will create at", default_json) template_settings = LocationService.get_mpfb_data("settings") default_json_template = os.path.join( template_settings, "enhanced_settings.default.json") _LOG.warn("Copying from", default_json_template) shutil.copy(default_json_template, default_json) else: _LOG.trace("Default enhanced settings exist") if UiService.get_enhanced_settings_panel_list() is None: UiService.rebuild_enhanced_settings_panel_list() layout = self.layout scene = context.scene self._load_save_box( scene, self._create_box(layout, "Load/save presets", "MODIFIER")) @classmethod def poll(cls, context): obj = context.active_object if not obj: return False if ObjectService.object_is_basemesh_or_body_proxy(obj): return True if ObjectService.object_is_skeleton(obj): return True return False
class MPFB_PT_MakeSkin_Panel(Abstract_Panel): """MakeSkin main panel.""" bl_label = "MakeSkin" bl_category = UiService.get_value("MATERIALSCATEGORY") bl_options = {'DEFAULT_CLOSED'} bl_parent_id = "MPFB_PT_Create_Panel" def _create_material(self, scene, layout): box = self._create_box(layout, "Create material", "TOOL_SETTINGS") props = [ "overwrite", #"create_node_visualization" "create_diffusetexture", "create_normalmap", "create_bumpmap", "create_transmissionmap", "create_roughnessmap", "create_metallicmap", "create_displacementmap" ] MAKESKIN_PROPERTIES.draw_properties(scene, box, props) box.operator('mpfb.create_makeskin_material') def _import_material(self, layout): box = self._create_box(layout, "Import", "MATERIAL_DATA") box.operator('mpfb.import_makeskin_material') def _save_material(self, blender_object, layout): box = self._create_box(layout, "Write material", "MATERIAL_DATA") props = [ "name", "description", "tag", "license", "author", "homepage", "backface_culling", "cast_shadows", "receive_shadows", "alpha_to_coverage", "shadeless", "wireframe", "transparent", "depthless", "sss_enable", "auto_blend", "textures", "use_litsphere", "litsphere" ] MakeSkinObjectProperties.draw_properties(blender_object, box, props) box.operator('mpfb.write_makeskin_material') def draw(self, context): _LOG.enter() layout = self.layout scene = context.scene blender_object = context.active_object if blender_object is None: return if blender_object.type == "MESH": self._create_material(scene, layout) self._import_material(layout) self._save_material(blender_object, layout)
class MPFB_PT_Rigify_Panel(Abstract_Panel): """The rigfy functionality panel.""" bl_label = "Convert to rigify" bl_category = UiService.get_value("RIGCATEGORY") bl_options = {'DEFAULT_CLOSED'} bl_parent_id = "MPFB_PT_Rig_Panel" def draw(self, context): _LOG.enter() layout = self.layout scene = context.scene RIGIFY_PROPERTIES.draw_properties(scene, layout, ["produce", "keep_meta"]) layout.operator("mpfb.convert_to_rigify")
class MPFB_PT_Eye_Settings_Panel(Abstract_Panel): """Panel for saving/loading eye material settings.""" bl_label = "Eye material presets" bl_category = UiService.get_value("MATERIALSCATEGORY") bl_options = {'DEFAULT_CLOSED'} bl_parent_id = "MPFB_PT_Presets_Panel" def _load_save_box(self, scene, layout): _LOG.enter() EYE_SETTINGS_PROPERTIES.draw_properties(scene, layout, ["available_settings"]) layout.operator('mpfb.eyesettings_apply_settings') layout.operator('mpfb.overwrite_eye_settings') EYE_SETTINGS_PROPERTIES.draw_properties(scene, layout, ["name"]) layout.operator('mpfb.save_new_eye_settings') def draw(self, context): _LOG.enter() ensure_eye_settings_default_exists() if UiService.get_eye_settings_panel_list() is None: UiService.rebuild_eye_settings_panel_list() layout = self.layout scene = context.scene self._load_save_box( scene, self._create_box(layout, "Load/save presets", "MODIFIER")) @classmethod def poll(cls, context): obj = context.active_object if not obj: return False if ObjectService.object_is_basemesh_or_body_proxy(obj): return True if ObjectService.object_is_skeleton(obj): return True if ObjectService.object_is_eyes(obj): return True return False
class MPFB_PT_NewHuman_Panel(bpy.types.Panel): """Create human from scratch main panel.""" bl_label = "From scratch" bl_space_type = "VIEW_3D" bl_region_type = "UI" bl_category = UiService.get_value("MODELCATEGORY") bl_options = {'DEFAULT_CLOSED'} bl_parent_id = "MPFB_PT_New_Panel" def _create_box(self, layout, box_text): _LOG.enter() box = layout.box() box.label(text=box_text) return box def _create(self, scene, layout): box = self._create_box(layout, "Create") NEW_HUMAN_PROPERTIES.draw_properties(scene, box, [ "scale_factor", "detailed_helpers", "extra_vertex_groups", "mask_helpers" ]) box.operator('mpfb.create_human') def _phenotype(self, scene, layout): box = self._create_box(layout, "Phenotype") NEW_HUMAN_PROPERTIES.draw_properties(scene, box, [ "phenotype_gender", "phenotype_age", "phenotype_muscle", "phenotype_weight", "phenotype_height", "phenotype_race", "add_phenotype", "phenotype_influence" ]) def _breast(self, scene, layout): box = self._create_box(layout, "Breast") NEW_HUMAN_PROPERTIES.draw_properties(scene, box, [ "phenotype_breastsize", "phenotype_breastfirmness", "add_breast", "breast_influence" ]) def draw(self, context): _LOG.enter() layout = self.layout scene = context.scene self._phenotype(scene, layout) self._breast(scene, layout) self._create(scene, layout)
class MPFB_PT_Load_Clothes_Panel(Abstract_Panel): """UI for loading MHCLO files.""" bl_label = "Load MHCLO" bl_category = UiService.get_value("CLOTHESCATEGORY") bl_options = {'DEFAULT_CLOSED'} bl_parent_id = "MPFB_PT_Assets_Panel" def draw(self, context): _LOG.enter() layout = self.layout scene = context.scene LOAD_CLOTHES_PROPERTIES.draw_properties(scene, layout, [ "object_type", "material_type", "fit_to_body", "delete_group", "specific_delete_group", "set_up_rigging", "interpolate_weights", "makeclothes_metadata" ]) layout.operator("mpfb.load_clothes")
class Abstract_Panel(bpy.types.Panel): """Human modeling panel.""" bl_label = "Abstract panel" bl_space_type = "VIEW_3D" bl_region_type = "UI" bl_category = UiService.get_value("DEVELOPERCATEGORY") bl_options = {'DEFAULT_CLOSED'} def create_box(self, layout, box_text, icon=None): _LOG.enter() box = layout.box() box.label(text=box_text) return box def _create_box(self, layout, box_text, icon=None): return self.create_box(layout, box_text, icon)
class MPFB_PT_MakeTarget_Panel(Abstract_Panel): """MakeTarget main panel.""" bl_label = "MakeTarget" bl_category = UiService.get_value("TARGETSCATEGORY") bl_options = {'DEFAULT_CLOSED'} bl_parent_id = "MPFB_PT_Create_Panel" def _initialize_target(self, blender_object, layout): box = self._create_box(layout, "Initialize", "TOOL_SETTINGS") props = ["name"] MakeTargetObjectProperties.draw_properties(blender_object, box, props) box.operator('mpfb.create_maketarget_target') box.operator('mpfb.import_maketarget_target') def _save_target(self, scene, layout): box = self._create_box(layout, "Save target", "TOOL_SETTINGS") box.operator('mpfb.write_maketarget_target') def _symmetrize_target(self, scene, layout): box = self._create_box(layout, "Symmetrize", "TOOL_SETTINGS") box.operator('mpfb.symmetrize_maketarget_left') box.operator('mpfb.symmetrize_maketarget_right') def _debug_target(self, scene, layout): box = self._create_box(layout, "Debug", "TOOL_SETTINGS") box.operator('mpfb.print_maketarget_target') def draw(self, context): _LOG.enter() layout = self.layout scene = context.scene blender_object = context.active_object if blender_object is None: return object_type = GeneralObjectProperties.get_value("object_type", entity_reference=blender_object) if object_type == "Basemesh": if not blender_object.data.shape_keys: self._initialize_target(blender_object, layout) else: self._save_target(scene, layout) self._symmetrize_target(scene, layout) self._debug_target(scene, layout)
class MPFB_PT_Asset_Settings_Panel(Abstract_Panel): """Settings for loading asset files.""" bl_label = "Library Settings" bl_category = UiService.get_value("CLOTHESCATEGORY") bl_options = {'DEFAULT_CLOSED'} bl_parent_id = "MPFB_PT_Assets_Panel" def _draw_mhclo(self, scene, layout): box = layout.box() box.label(text="Clothes, Bodyparts & Proxies") ASSET_SETTINGS_PROPERTIES.draw_properties(scene, box, [ "fit_to_body", "mask_base_mesh", "delete_group", "specific_delete_group", "set_up_rigging", "interpolate_weights", "add_subdiv_modifier", "subdiv_levels", "makeclothes_metadata" ]) def _draw_skin(self, scene, layout): box = layout.box() box.label(text="Skin") ASSET_SETTINGS_PROPERTIES.draw_properties( scene, box, ["skin_type", "material_instances"]) def _draw_eyes(self, scene, layout): box = layout.box() box.label(text="Eyes") ASSET_SETTINGS_PROPERTIES.draw_properties(scene, box, ["procedural_eyes"]) def _packs(self, scene, layout): box = layout.box() box.label(text="Asset packs") box.operator("mpfb.load_pack") def draw(self, context): _LOG.enter() layout = self.layout scene = context.scene self._draw_skin(scene, layout) self._draw_eyes(scene, layout) self._draw_mhclo(scene, layout) self._packs(scene, layout)
class MPFB_PT_Rig_Panel(Abstract_Panel): bl_label = "Rigging" bl_category = UiService.get_value("MODELCATEGORY") def draw(self, context): _LOG.enter() layout = self.layout scn = context.scene @classmethod def poll(cls, context): obj = context.active_object if not obj: return False if ObjectService.object_is_basemesh_or_body_proxy(obj): return True if ObjectService.object_is_skeleton(obj): return True return False
class MPFB_PT_Model_Panel(bpy.types.Panel): """Human modeling panel.""" bl_label = "Model" bl_idname = "MPFB_PT_Model_Panel" bl_space_type = "VIEW_3D" bl_region_type = "UI" bl_category = UiService.get_value("MODELCATEGORY") bl_options = {'DEFAULT_CLOSED'} def _create_box(self, layout, box_text): _LOG.enter() box = layout.box() box.label(text=box_text) return box def _refit(self, scene, layout): box = self._create_box(layout, "Refit") #======================================================================= # NEW_HUMAN_PROPERTIES.draw_properties(scene, box, [ # "scale_factor", # "detailed_helpers", # "extra_vertex_groups", # "mask_helpers" # ]) # box.operator('mpfb.create_human') #======================================================================= def draw(self, context): _LOG.enter() layout = self.layout scene = context.scene self._refit(scene, layout) @classmethod def poll(cls, context): return ObjectService.object_is_basemesh(context.active_object)
class MPFB_PT_Dir_Resources_Panel(Abstract_Panel): """UI for opening dir links.""" bl_label = "Directories" bl_category = UiService.get_value("DEVELOPERCATEGORY") bl_options = {'DEFAULT_CLOSED'} bl_parent_id = "MPFB_PT_System_Panel" def _path(self, layout, label, path): dirlink = layout.operator("mpfb.dir_resource", text=label) dirlink.path = path def draw(self, context): _LOG.enter() layout = self.layout user_files = LocationService.get_user_home() library_files = LocationService.get_user_data() system_data = LocationService.get_mpfb_data() log_files = LocationService.get_user_home("logs") self._path(layout, "User files", user_files) self._path(layout, "Library files", library_files) self._path(layout, "System data", system_data) self._path(layout, "Log files", log_files)
class MPFB_PT_Importer_Presets_Panel(Abstract_Panel): bl_label = "Importer Presets" bl_category = UiService.get_value("IMPORTERCATEGORY") bl_options = {'DEFAULT_CLOSED'} bl_parent_id = "MPFB_PT_New_Panel" def _create_box(self, layout, box_text, box_icon=None): _LOG.enter() box = layout.box() box.label(text=box_text, icon=box_icon) return box def _load_save_box(self, scene, layout): _LOG.enter() IMPORTER_PRESETS_PROPERTIES.draw_properties(scene, layout, ["available_presets"]) layout.operator('mpfb.importerpresets_load_importer_presets') layout.operator('mpfb.importerpresets_overwrite_importer_presets') IMPORTER_PRESETS_PROPERTIES.draw_properties(scene, layout, ["name"]) layout.operator('mpfb.importerpresets_save_new_importer_presets') def _what_box(self, scene, layout): _LOG.enter() props = [ "import_body", "import_body_proxy", "import_body_parts", "import_clothes", "import_rig", "rig_as_parent" ] IMPORTER_PRESETS_PROPERTIES.draw_properties(scene, layout, props) def _general_box(self, scene, layout): _LOG.enter() props = [ "scale_factor", "feet_on_ground", "create_collection", "collections_as_children", "prefix_object_names" ] IMPORTER_PRESETS_PROPERTIES.draw_properties(scene, layout, props) def _mesh_and_groups_box(self, scene, layout): _LOG.enter() props = [ "mask_base_mesh", "add_subdiv_modifier", "subdiv_levels", "handle_helpers", "detailed_helpers", "extra_vertex_groups" ] IMPORTER_PRESETS_PROPERTIES.draw_properties(scene, layout, props) def _materials_box(self, scene, layout): _LOG.enter() props = [ "skin_material_type", "material_named_from_object", "prefix_material_names", "material_creation_policy", "material_instances", "procedural_eyes", "fix_bad_roughness" ] IMPORTER_PRESETS_PROPERTIES.draw_properties(scene, layout, props) def _network_box(self, scene, layout): pass def draw(self, context): _LOG.enter() default_json = LocationService.get_user_config( "importer_presets.default.json") if not os.path.exists(default_json): _LOG.warn( "The default importer presets do not exist. Will create these." ) excludes = ["available_presets", "name"] IMPORTER_PRESETS_PROPERTIES.serialize_to_json( default_json, entity_reference=context, exclude_keys=excludes) else: _LOG.trace("Default presets exist") if UiService.get_importer_presets_panel_list() is None: UiService.rebuild_importer_presets_panel_list() layout = self.layout scene = context.scene self._load_save_box( scene, self._create_box(layout, "Load/save presets", "MODIFIER")) self._what_box(scene, self._create_box(layout, "What to import", "MODIFIER")) self._general_box(scene, self._create_box(layout, "General", "MODIFIER")) self._mesh_and_groups_box( scene, self._create_box(layout, "Mesh and vGroups", "MODIFIER")) self._materials_box(scene, self._create_box(layout, "Materials", "MODIFIER")) self._network_box(scene, self._create_box(layout, "Network", "MODIFIER"))
class MPFB_PT_RigHelpersPanel(Abstract_Panel): bl_label = "Rig helpers" bl_category = UiService.get_value("RIGCATEGORY") bl_options = {'DEFAULT_CLOSED'} bl_parent_id = "MPFB_PT_Rig_Panel" def _arm_helpers(self, scene, layout): box = self._create_box(layout, "Arm helpers", "BONE_DATA") props = [ "arm_helpers_type", "arm_parenting_strategy", "arm_target_rotates_hand", "arm_target_rotates_lower_arm" ] SETUP_HELPERS_PROPERTIES.draw_properties(scene, box, props) def _leg_helpers(self, scene, layout): box = self._create_box(layout, "Leg helpers", "BONE_DATA") props = [ "leg_helpers_type", "leg_parenting_strategy", "leg_target_rotates_foot", "leg_target_rotates_lower_leg" ] SETUP_HELPERS_PROPERTIES.draw_properties(scene, box, props) def _finger_helpers(self, scene, layout): box = self._create_box(layout, "Finger helpers", "BONE_DATA") props = [ "finger_helpers_type" ] SETUP_HELPERS_PROPERTIES.draw_properties(scene, box, props) def _eye_helpers(self, scene, layout): box = self._create_box(layout, "Eye helpers", "BONE_DATA") props = [ "eye_ik", "eye_parenting_strategy" ] SETUP_HELPERS_PROPERTIES.draw_properties(scene, box, props) def _apply_helpers(self, scene, layout): box = self._create_box(layout, "Apply", "ARMATURE_DATA") props = [ "hide_fk", "preserve_fk" ] SETUP_HELPERS_PROPERTIES.draw_properties(scene, box, props) box.operator("mpfb.add_helpers") def _remove_helpers(self, scene, layout): box = self._create_box(layout, "Remove", "ARMATURE_DATA") box.operator("mpfb.remove_helpers") def draw(self, context): _LOG.enter() layout = self.layout scene = context.scene if context.object is None or context.object.type != 'ARMATURE': return armature_object = context.object finger_mode = RigHelpersProperties.get_value("finger_mode", entity_reference=armature_object) leg_mode = RigHelpersProperties.get_value("leg_mode", entity_reference=armature_object) arm_mode = RigHelpersProperties.get_value("arm_mode", entity_reference=armature_object) eye_mode = RigHelpersProperties.get_value("eye_mode", entity_reference=armature_object) if finger_mode or leg_mode or arm_mode or eye_mode: self._remove_helpers(scene, layout) else: self._arm_helpers(scene, layout) self._leg_helpers(scene, layout) self._finger_helpers(scene, layout) self._eye_helpers(scene, layout) self._apply_helpers(scene, layout)