Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaurice Raybaud <mauriceraybaud@hotmail.fr>2017-06-17 21:17:44 +0300
committerMaurice Raybaud <mauriceraybaud@hotmail.fr>2017-06-17 21:17:44 +0300
commit6fd569bc7404ad9d7a18f1b90f46075264a6c0cc (patch)
tree7d9a688c793c328cdcd2b24b8b7c49704cb46259 /render_povray
parente813b903c340fdc1edb2d51c4c5c492a55f367bf (diff)
*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.
Diffstat (limited to 'render_povray')
-rw-r--r--render_povray/__init__.py8
-rw-r--r--render_povray/ui.py24
2 files changed, 25 insertions, 7 deletions
diff --git a/render_povray/__init__.py b/render_povray/__init__.py
index b95103b9..a04977a4 100644
--- a/render_povray/__init__.py
+++ b/render_povray/__init__.py
@@ -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)
diff --git a/render_povray/ui.py b/render_povray/ui.py
index 0feecec9..6fa703ee 100644
--- a/render_povray/ui.py
+++ b/render_povray/ui.py
@@ -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"