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:
authorAntonioya <blendergit@gmail.com>2016-08-09 19:01:14 +0300
committerAntonioya <blendergit@gmail.com>2016-08-09 19:01:14 +0300
commitf3a93f08e81a185e058f2acb0ec4c7e1cc99f8d5 (patch)
tree6dd59ef3ce1f128c7c886f67ff518e121f1b05f4 /archimesh/achm_door_maker.py
parentce2ced159895f41a7dbfac38f61e6d3421dd7346 (diff)
Archimesh: Fix error when Cycles is not enabled
Now if cycles render is not enabled or not selected, the materials are not created.
Diffstat (limited to 'archimesh/achm_door_maker.py')
-rw-r--r--archimesh/achm_door_maker.py40
1 files changed, 22 insertions, 18 deletions
diff --git a/archimesh/achm_door_maker.py b/archimesh/achm_door_maker.py
index b0908209..64ba7829 100644
--- a/archimesh/achm_door_maker.py
+++ b/archimesh/achm_door_maker.py
@@ -205,7 +205,7 @@ def shape_children(mainobject, update=False):
mydoor = make_one_door(mp, mainobject, widthr + mp.frame_size, "1")
mydoor.location.x = mp.frame_width / 2 - mp.frame_size
- if mp.crt_mat:
+ if mp.crt_mat and bpy.context.scene.render.engine == 'CYCLES':
mat = create_diffuse_material("Door_material", False, 0.8, 0.8, 0.8)
set_material(mainobject, mat)
@@ -236,12 +236,13 @@ def shape_children(mainobject, update=False):
myctrl.draw_type = 'BOUNDS'
myctrl.hide = False
myctrl.hide_render = True
- myctrl.cycles_visibility.camera = False
- myctrl.cycles_visibility.diffuse = False
- myctrl.cycles_visibility.glossy = False
- myctrl.cycles_visibility.transmission = False
- myctrl.cycles_visibility.scatter = False
- myctrl.cycles_visibility.shadow = False
+ if bpy.context.scene.render.engine == 'CYCLES':
+ myctrl.cycles_visibility.camera = False
+ myctrl.cycles_visibility.diffuse = False
+ myctrl.cycles_visibility.glossy = False
+ myctrl.cycles_visibility.transmission = False
+ myctrl.cycles_visibility.scatter = False
+ myctrl.cycles_visibility.shadow = False
# Create control box for baseboard
myctrlbase = create_control_box("CTRL_Baseboard",
@@ -258,16 +259,17 @@ def shape_children(mainobject, update=False):
myctrlbase.draw_type = 'BOUNDS'
myctrlbase.hide = False
myctrlbase.hide_render = True
- myctrlbase.cycles_visibility.camera = False
- myctrlbase.cycles_visibility.diffuse = False
- myctrlbase.cycles_visibility.glossy = False
- myctrlbase.cycles_visibility.transmission = False
- myctrlbase.cycles_visibility.scatter = False
- myctrlbase.cycles_visibility.shadow = False
-
- mat = create_transparent_material("hidden_material", False)
- set_material(myctrl, mat)
- set_material(myctrlbase, mat)
+ if bpy.context.scene.render.engine == 'CYCLES':
+ myctrlbase.cycles_visibility.camera = False
+ myctrlbase.cycles_visibility.diffuse = False
+ myctrlbase.cycles_visibility.glossy = False
+ myctrlbase.cycles_visibility.transmission = False
+ myctrlbase.cycles_visibility.scatter = False
+ myctrlbase.cycles_visibility.shadow = False
+
+ mat = create_transparent_material("hidden_material", False)
+ set_material(myctrl, mat)
+ set_material(myctrlbase, mat)
# deactivate others
for o in bpy.data.objects:
@@ -457,6 +459,8 @@ class AchmDoorObjectgeneratorpanel(Panel):
layout.prop(myobjdat, 'handle')
box = layout.box()
+ if not context.scene.render.engine == 'CYCLES':
+ box.enabled = False
box.prop(myobjdat, 'crt_mat')
else:
row = layout.row()
@@ -539,7 +543,7 @@ def make_one_door(self, myframe, width, openside):
set_smooth(handle2)
set_modifier_subsurf(handle2)
# Create materials
- if self.crt_mat:
+ if self.crt_mat and bpy.context.scene.render.engine == 'CYCLES':
# Door material
mat = create_diffuse_material("Door_material", False, 0.8, 0.8, 0.8)
set_material(mydoor, mat)