*Removed automatic activation of Add Mesh: extra objects used for 3d function surface (exported as pov parametric object)

*Replaced by a message and easy menu for user to activate it himself to avoid conflicts with other scripts when deactivating POV would also deactivate extras.
This commit is contained in:
Maurice Raybaud 2017-06-17 20:17:44 +02:00
parent e813b903c3
commit 6fd569bc74
2 changed files with 24 additions and 6 deletions

View File

@ -64,7 +64,6 @@ else:
update_files,
)
def string_strip_hyphen(name):
return name.replace("-", "")
@ -2176,8 +2175,9 @@ def register():
bpy.types.INFO_MT_add.prepend(ui.menu_func_add)
bpy.types.INFO_MT_file_import.append(ui.menu_func_import)
bpy.types.TEXT_MT_templates.append(ui.menu_func_templates)
#used for parametric objects:
addon_utils.enable("add_mesh_extra_objects", default_set=False, persistent=True)
# was used for parametric objects but made the other addon unreachable on
# unregister for other tools to use created a user action call instead
#addon_utils.enable("add_mesh_extra_objects", default_set=False, persistent=True)
#bpy.types.TEXTURE_PT_context_texture.prepend(TEXTURE_PT_povray_type)
@ -2203,7 +2203,7 @@ def unregister():
bpy.types.NODE_HT_header.remove(ui.menu_func_nodes)
#bpy.types.TEXTURE_PT_context_texture.remove(TEXTURE_PT_povray_type)
addon_utils.disable("add_mesh_extra_objects", default_set=False)
#addon_utils.disable("add_mesh_extra_objects", default_set=False)
bpy.types.TEXT_MT_templates.remove(ui.menu_func_templates)
bpy.types.INFO_MT_file_import.remove(ui.menu_func_import)
bpy.types.INFO_MT_add.remove(ui.menu_func_add)

View File

@ -177,7 +177,11 @@ for member in dir(properties_particle): # add all "particle" panels from blende
pass
del properties_particle
def check_add_mesh_extra_objects():
if "add_mesh_extra_objects" in bpy.context.user_preferences.addons.keys():
return True
return False
class RenderButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
@ -1586,7 +1590,6 @@ class BasicShapesMenu(bpy.types.Menu):
layout.operator("pov.cone_add", text="Cone",icon="MESH_CONE")
layout.operator("pov.addtorus", text="Torus",icon = 'MESH_TORUS')
layout.separator()
layout.operator("pov.addparametric", text="Parametric",icon = 'SCRIPTPLUGINS')
layout.operator("pov.addrainbow", text="Rainbow",icon="COLOR")
layout.operator("pov.addlathe", text="Lathe",icon = 'MOD_SCREW')
layout.operator("pov.addprism", text="Prism",icon = 'MOD_SOLIDIFY')
@ -1604,7 +1607,22 @@ class BasicShapesMenu(bpy.types.Menu):
layout.label(text = "Macro based")
layout.operator("pov.addpolygontocircle", text="Polygon To Circle Blending",icon="RETOPO")
layout.operator("pov.addloft", text="Loft",icon="SURFACE_NSURFACE")
layout.separator()
# Warning if the Add Advanced Objects addon containing
# Add mesh extra objects is not enabled
if not check_add_mesh_extra_objects():
#col = box.column()
layout.label(text="Please enable Add Mesh: Extra Objects addon", icon="INFO")
#layout.separator()
layout.operator("wm.addon_userpref_show",
text="Go to Add Mesh: Extra Objects addon",
icon="PREFERENCES").module = "add_mesh_extra_objects"
#layout.separator()
return
else:
layout.operator("pov.addparametric", text="Parametric",icon = 'SCRIPTPLUGINS')
class ImportMenu(bpy.types.Menu):
bl_idname = "Importer_calls"
bl_label = "Import"