fixed import errors for blender 4.2. but may cause problems. still all work on blender 4.1.1

pull/269/head
palain 2024-08-14 10:01:31 -03:00
rodzic cdb0a7e42c
commit 1e11fa9b8c
3 zmienionych plików z 13 dodań i 12 usunięć

Wyświetl plik

@ -72,7 +72,7 @@ from .curvecamtools import (
CamObjectSilhouete,
)
from .engine import (
BLENDERCAM_ENGINE,
CNCCAM_ENGINE,
get_panels,
)
from .machine_settings import machineSettings
@ -234,7 +234,7 @@ classes = [
CamObjectSilhouete,
# .engine
BLENDERCAM_ENGINE,
CNCCAM_ENGINE,
# .machine_settings
machineSettings,
@ -382,7 +382,7 @@ def register() -> None:
)
for panel in get_panels():
panel.COMPAT_ENGINES.add("BLENDERCAM_RENDER")
panel.COMPAT_ENGINES.add("CNCCAM_RENDER")
wm = bpy.context.window_manager
addon_kc = wm.keyconfigs.addon
@ -418,12 +418,12 @@ def unregister() -> None:
del scene.cam_slice
for panel in get_panels():
if 'BLENDERCAM_RENDER' in panel.COMPAT_ENGINES:
panel.COMPAT_ENGINES.remove('BLENDERCAM_RENDER')
if 'CNCCAM_RENDER' in panel.COMPAT_ENGINES:
panel.COMPAT_ENGINES.remove('CNCCAM_RENDER')
wm = bpy.context.window_manager
active_kc = wm.keyconfigs.active
for key in active_kc.keymaps['Object Mode'].keymap_items:
if (key.idname == 'wm.call_menu' and key.properties.name == 'VIEW3D_MT_PIE_CAM'):
active_kc.keymaps['Object Mode'].keymap_items.remove(key)
active_kc.keymaps['Object Mode'].keymap_items.remove(key)

Wyświetl plik

@ -1,4 +1,4 @@
"""BlenderCAM 'engine.py'
"""CNCCAM 'engine.py'
Engine definition, options and panels.
"""
@ -28,9 +28,9 @@ from .ui_panels.pack import CAM_PACK_Panel
from .ui_panels.slice import CAM_SLICE_Panel
class BLENDERCAM_ENGINE(RenderEngine):
bl_idname = "BLENDERCAM_RENDER"
bl_label = "BlenderCAM"
class CNCCAM_ENGINE(RenderEngine):
bl_idname = "CNCCAM_RENDER"
bl_label = "CNC CAM"
bl_use_eevee_viewport = True

Wyświetl plik

@ -1849,8 +1849,9 @@ def updateOperation(self, context):
def isValid(o, context):
valid = True
if o.geometry_source == 'OBJECT':
if o.object_name not in bpy.data.objects:
valid = False
if not o.object_name.endswith('_cut_bridges'): # let empty bridge cut be valid
if o.object_name not in bpy.data.objects:
valid = False
if o.geometry_source == 'COLLECTION':
if o.collection_name not in bpy.data.collections:
valid = False