Skip to content

Commit b08c29f

Browse files
committed
Fix vehicle frames flags selection. Small improvements
1 parent f1e72d9 commit b08c29f

5 files changed

Lines changed: 9 additions & 7 deletions

File tree

rct-graphics-helper/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"name": "RCT Graphics Helper",
2323
"description": "Render tool to replicate RCT graphics",
2424
"author": "Olivier Wervers",
25-
"version": (0, 3, 2),
25+
"version": (0, 3, 3),
2626
"blender": (2, 79, 0),
2727
"location": "Render",
2828
"support": "COMMUNITY",

rct-graphics-helper/builders/scene_builder.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def build(self, context):
2727
rig_obj = self.create_scene_object(context, "Rig", None)
2828
rig_obj.location = (0, 0, 0)
2929
rig_obj.rotation_euler = (0, 0, math.radians(-45))
30+
rig_obj.hide = True
3031
rig_obj.hide_select = True
3132

3233
rig_obj.rotation_mode = "YXZ"
@@ -37,6 +38,7 @@ def build(self, context):
3738
vertical_joint_obj = self.create_scene_object(
3839
context, "VerticalJoint", None)
3940
vertical_joint_obj.location = (0, 0, 0)
41+
vertical_joint_obj.hide = True
4042
vertical_joint_obj.hide_select = True
4143

4244
scene.objects.link(vertical_joint_obj)

rct-graphics-helper/operators/vehicle_render_operator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def should_render_feature(self, key, context):
8383
if self.property_value("SLOPED_TURNS", props) and self.property_value("VEHICLE_SPRITE_FLAG_FLAT_BANKED", props):
8484
return True
8585
elif key == "VEHICLE_SPRITE_FLAG_DIAGONAL_GENTLE_SLOPE_BANKED_TRANSITIONS":
86-
if self.property_value("SLOPED_TURNS", props) and self.property_value("VEHICLE_SPRITE_FLAG_DIAGONAL_SLOPES", props):
86+
if self.property_value("VEHICLE_SPRITE_FLAG_FLAT_BANKED", props) and self.property_value("VEHICLE_SPRITE_FLAG_DIAGONAL_SLOPES", props):
8787
return True
8888
elif key == "VEHICLE_SPRITE_FLAG_FLAT_TO_GENTLE_SLOPE_BANKED_TRANSITIONS":
8989
if self.property_value("VEHICLE_SPRITE_FLAG_FLAT_BANKED", props) and self.property_value("VEHICLE_SPRITE_FLAG_GENTLE_SLOPES", props):
@@ -108,14 +108,14 @@ def add_render_angles(self, context, is_inverted=False, animation_frames=1):
108108
if track_section[0]:
109109
base_view_angle = 45
110110
self.task_builder.set_rotation(
111-
base_view_angle, track_section[3] + extra_roll, track_section[2], track_section[4])
111+
base_view_angle, -track_section[3] - extra_roll, track_section[2], track_section[4])
112112

113113
if key == "VEHICLE_SPRITE_FLAG_RESTRAINT_ANIMATION":
114114
for j in range(3):
115115
for k in range(track_section[1]):
116116
for l in range(animation_frames):
117117
self.task_builder.set_rotation(
118-
base_view_angle + k / track_section[1] * 360, track_section[3] + extra_roll, track_section[2], track_section[4])
118+
base_view_angle + k / track_section[1] * 360, -track_section[3] - extra_roll, track_section[2], track_section[4])
119119
self.task_builder.add_viewing_angles(
120120
1, animation_frames + j, 1)
121121
else:

rct-graphics-helper/processors/render_task_processor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def __init__(self, context, palette_manager):
4848
]
4949

5050
self.prioritize_final_output = True
51-
self.cleanup_afterwards = False
51+
self.cleanup_afterwards = True
5252

5353
def process(self, task, callback):
5454
def finalize():
@@ -207,7 +207,7 @@ def _inject_object_descriptor(self, task, images):
207207
if not os.path.exists(file_path):
208208
return None
209209

210-
with open(file_path, "r+") as object_file:
210+
with open(file_path, mode="r+", encoding="utf-8") as object_file:
211211
data = json.loads(object_file.read(),
212212
object_pairs_hook=OrderedDict)
213213

@@ -216,7 +216,7 @@ def _inject_object_descriptor(self, task, images):
216216
object_file.seek(0)
217217
object_file.truncate()
218218

219-
object_file.write(json.dumps(data, indent=4))
219+
object_file.write(json.dumps(data, indent=4, ensure_ascii=False))
220220
object_file.close()
221221

222222
if data.get("id") == None:
48 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)