Skip to content

Commit b36f04f

Browse files
Prevent airplane shadow accidently lighting other layers
1 parent 214d09d commit b36f04f

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

loco-graphics-helper/builders/scene_builder.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ def create_airplane_shadow_light(self, context):
200200

201201
lamp_object.hide = True
202202
lamp_object.hide_select = True
203+
lamp_object.hide_render = True
203204
lamp_object.location = (0, 0, 0)
204205
lamp_object.rotation_euler = (math.radians(0), 0, math.radians(90))
205206

loco-graphics-helper/frame.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ def prepare_scene(self):
101101

102102
object.location = self.target_object.location
103103

104+
# This is a little hacky...
105+
if self.layer == 'Top Down Shadow':
106+
bpy.data.objects['AirplaneShadowLight'].hide_render = False
107+
else:
108+
bpy.data.objects['AirplaneShadowLight'].hide_render = True
109+
104110
object.rotation_euler = (math.radians(self.bank_angle),
105111
math.radians(self.vertical_angle), math.radians(self.mid_angle))
106112
vJoint = object.children[0]

loco-graphics-helper/rct_graphics_helper_panel.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,8 @@ def draw_vehicle_panel(self, scene, layout):
326326
mid_point_x = (front.location[0] - back.location[0]) / 2 + back.location[0]
327327
if not math.isclose(body.location[0], mid_point_x, rel_tol=1e-4):
328328
warning = "BODY LOCATION IS NOT AT MID X POINT BETWEEN BOGIES! {}".format(mid_point_x)
329-
329+
elif body.loco_graphics_helper_vehicle_properties.is_airplane:
330+
front_idx = 0
330331

331332
row = layout.row()
332333
row.label(" {}. {}, Half-Width: {}, Front Position: {}, Back Position: {}".format(idx, body.name, self.blender_to_loco_dist(half_width), self.blender_to_loco_dist(front_position), self.blender_to_loco_dist(back_position)))

0 commit comments

Comments
 (0)