X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=blender%2Fio_mspgl%2Fscene.py;h=e4f31067cd8a910e48b842e6b66d04cde1f0259f;hb=f7682c3c2e9f028cef6945ffbada66cff33585c0;hp=03e239e6a77dce8dcb601e59230512d73e9c6a1f;hpb=b7578c64755c203c1bbfbe539f29e68544dd1b17;p=libs%2Fgl.git diff --git a/blender/io_mspgl/scene.py b/blender/io_mspgl/scene.py index 03e239e6..e4f31067 100644 --- a/blender/io_mspgl/scene.py +++ b/blender/io_mspgl/scene.py @@ -25,6 +25,8 @@ class Scene: self.instances = [] self.blended_instances = [] self.lights = [] + self.realtime_sky = False + self.sun_light = None self.ambient_light = mathutils.Color((0.0, 0.0, 0.0)) self.exposure = scene.view_settings.exposure @@ -43,6 +45,12 @@ class Scene: s = surface_node.inputs["Strength"].default_value self.ambient_light = mathutils.Color(c[:3])*s + self.use_sky = scene.world.use_sky and scene.world.sun_light + self.sun_light = scene.world.sun_light + + self.use_shadow = False + self.use_ibl = False + objects = scene.objects[:] objects.sort(key=lambda o:o.name) if obj_filter: @@ -57,13 +65,19 @@ class Scene: clones = [c for c in objects if is_same_object(o, c)] self.prototypes.append(o) instance_list = self.instances - if o.material_slots and o.material_slots[0].material and o.material_slots[0].material.blend_method=='BLEND': - instance_list = self.blended_instances + if o.material_slots and o.material_slots[0].material: + mat = o.material_slots[0].material + if mat.blend_method=='BLEND': + instance_list = self.blended_instances + if mat.image_based_lighting: + self.use_ibl = True for c in clones: instance_list.append(Instance(c, o)) processed.add(c.name) elif o.type=='LIGHT': self.lights.append(o) + if o.data.use_shadow: + self.use_shadow = True def get_chain(self): result = []