I try to import from the file "boolean_2d_union" the function but fail to be able to get this right.
I have the following structure
add-on folder:
__init__.py
addons (folder)
boolean_2d_union.py
Here is the script of my ini file.
bl_info = {
"name": "Fullscreen Modeling Pie Menus",
"author": "Claas Kuhnen",
"version": (1, 0),
"blender": (2, 75, 0),
"location": "View3D > Pie Menus",
"description": "Pie Menus for Modeling and Object Properties",
"warning": "Beta - Concepy Study",
"category": "User Interface",
}
import math
import bmesh
import bpy, os
from bpy.types import Menu, Header, Panel, UIList
from bpy.props import IntProperty, FloatProperty, BoolProperty,EnumProperty,StringProperty
from mathutils import *
from boolean_2d_union import Boolean2DUnion
class PieTest(Menu):
bl_idname = "pie.test"
bl_label = "Pie Test"
def draw(self, context):
layout = self.layout
pie = layout.menu_pie()
#4
pie.operator("bpt.boolean_2d_union", text="Import Test")
addon_keymaps = []
def register():
bpy.utils.register_module(__name__)
wm = bpy.context.window_manager
if wm.keyconfigs.addon:
#Viewport Shade
km = wm.keyconfigs.addon.keymaps.new(name = 'Object Non-modal')
kmi = km.keymap_items.new('wm.call_menu_pie', "RIGHTMOUSE", "PRESS", shift=True, ctrl=True)
kmi.properties.name = "pie.test"
def unregister():
bpy.utils.unregister_module(__name__)
wm = bpy.context.window_manager
if wm.keyconfigs.addon:
for km in addon_keymaps:
for kmi in km.keymap_items:
km.keymap_items.remove(kmi)
wm.keyconfigs.addon.keymaps.remove(km)
# clear the list
del addon_keymaps[:]
if __name__ == "__main__":
register()
I always get a syntax error:
I added a link to the add-on zip file URL
Inside the file boolean_2d_union.py this is the following code:
class Boolean2DUnion(bpy.types.Operator):
bl_idname = "bpt.boolean_2d_union"
bl_label = "Boolean 2D Union"
bl_options = {'REGISTER', 'UNDO'}
addon_keymaps
, but it's a different matter with a working example already $\endgroup$