Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions loco-graphics-helper/rct_graphics_helper_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,10 @@ def draw_vehicle_panel(self, scene, layout):

components = get_car_components(cars)
if len(components) == 0:
return
col = layout.column()
col.label(text="No cars detected.")
col.label(text="Ensure at least one BODY is parented to a CAR")
return
row = layout.row()
row.label("Car(s) details:")

Expand All @@ -250,7 +253,7 @@ def draw_vehicle_panel(self, scene, layout):
back_name = '' if back is None else back.name
mid_point_x = component.get_preferred_body_midpoint()
if not math.isclose(body.matrix_world.translation[0], mid_point_x, rel_tol=1e-4):
warning = "BODY LOCATION IS NOT AT PREFERRED MID X POINT! {}".format(mid_point_x)
warning = "BODY LOCATION IS NOT AT PREFERRED MID X POINT! {}".format(round(mid_point_x,1))

if not front is None:
front_position = component.get_bogie_position(SubComponent.FRONT)
Expand Down
2 changes: 1 addition & 1 deletion loco-graphics-helper/vehicle.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def get_car_components(cars) -> List[VehicleComponent]:
component_animations = [x for x in car.children if x.loco_graphics_helper_object_properties.object_type == 'ANIMATION']

if len(component_bodies) != 1:
print("Malformed car {}".format(car.name))
print("Car {} requires at least one child BODY".format(car.name))
continue

if len(component_bogies) != 2:
Expand Down