From 114756a4b10251a3d97a561b2088779713650335 Mon Sep 17 00:00:00 2001 From: 1k8 Date: Mon, 12 Aug 2024 04:15:10 -0400 Subject: [PATCH 01/10] Update nodes_converter.py --- .../material/cycles_nodes/nodes_converter.py | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/blender/arm/material/cycles_nodes/nodes_converter.py b/blender/arm/material/cycles_nodes/nodes_converter.py index 8c350c5caa..db1c5c0ca9 100644 --- a/blender/arm/material/cycles_nodes/nodes_converter.py +++ b/blender/arm/material/cycles_nodes/nodes_converter.py @@ -138,15 +138,15 @@ def parse_valtorgb(node: bpy.types.ShaderNodeValToRGB, out_socket: bpy.types.Nod rel_pos = f'({fac_var} - {prev_stop_fac}) * (1.0 / ({next_stop_fac} - {prev_stop_fac}))' return f'mix({prev_stop_col}, {next_stop_col}, max({rel_pos}, 0.0))' - -def parse_combine_color(node: bpy.types.ShaderNodeCombineColor, out_socket: bpy.types.NodeSocket, state: ParserState) -> floatstr: - if node.mode == 'RGB': - return parse_combrgb(node, out_socket, state) - elif node.mode == 'HSV': - return parse_combhsv(node, out_socket, state) - elif node.mode == 'HSL': - log.warn('Combine Color node: HSL mode is not supported, using default value') - return c.to_vec3((0.0, 0.0, 0.0)) +if bpy.app.version > (3, 2, 0): + def parse_combine_color(node: bpy.types.ShaderNodeCombineColor, out_socket: bpy.types.NodeSocket, state: ParserState) -> floatstr: + if node.mode == 'RGB': + return parse_combrgb(node, out_socket, state) + elif node.mode == 'HSV': + return parse_combhsv(node, out_socket, state) + elif node.mode == 'HSL': + log.warn('Combine Color node: HSL mode is not supported, using default value') + return c.to_vec3((0.0, 0.0, 0.0)) def parse_combhsv(node: bpy.types.ShaderNodeCombineHSV, out_socket: bpy.types.NodeSocket, state: ParserState) -> vec3str: @@ -356,15 +356,15 @@ def parse_math(node: bpy.types.ShaderNodeMath, out_socket: bpy.types.NodeSocket, def parse_rgbtobw(node: bpy.types.ShaderNodeRGBToBW, out_socket: bpy.types.NodeSocket, state: ParserState) -> floatstr: return c.rgb_to_bw(c.parse_vector_input(node.inputs[0])) - -def parse_separate_color(node: bpy.types.ShaderNodeSeparateColor, out_socket: bpy.types.NodeSocket, state: ParserState) -> floatstr: - if node.mode == 'RGB': - return parse_seprgb(node, out_socket, state) - elif node.mode == 'HSV': - return parse_sephsv(node, out_socket, state) - elif node.mode == 'HSL': - log.warn('Separate Color node: HSL mode is not supported, using default value') - return '0.0' +if bpy.app.version > (3, 2, 0): + def parse_separate_color(node: bpy.types.ShaderNodeSeparateColor, out_socket: bpy.types.NodeSocket, state: ParserState) -> floatstr: + if node.mode == 'RGB': + return parse_seprgb(node, out_socket, state) + elif node.mode == 'HSV': + return parse_sephsv(node, out_socket, state) + elif node.mode == 'HSL': + log.warn('Separate Color node: HSL mode is not supported, using default value') + return '0.0' def parse_sephsv(node: bpy.types.ShaderNodeSeparateHSV, out_socket: bpy.types.NodeSocket, state: ParserState) -> floatstr: From 28fd9e5a7b7de1518f5ed77548a9bca006993faf Mon Sep 17 00:00:00 2001 From: 1k8 Date: Mon, 12 Aug 2024 04:19:14 -0400 Subject: [PATCH 02/10] Update nodes_shader.py --- .../arm/material/cycles_nodes/nodes_shader.py | 100 ++++++++++++------ 1 file changed, 66 insertions(+), 34 deletions(-) diff --git a/blender/arm/material/cycles_nodes/nodes_shader.py b/blender/arm/material/cycles_nodes/nodes_shader.py index 075e7a7019..5fa0aece01 100644 --- a/blender/arm/material/cycles_nodes/nodes_shader.py +++ b/blender/arm/material/cycles_nodes/nodes_shader.py @@ -75,33 +75,47 @@ def parse_addshader(node: bpy.types.ShaderNodeAddShader, out_socket: NodeSocket, state.out_opacity = '({0} * 0.5 + {1} * 0.5)'.format(opac1, opac2) state.out_ior = '({0} * 0.5 + {1} * 0.5)'.format(ior1, ior2) -def parse_bsdfprincipled(node: bpy.types.ShaderNodeBsdfPrincipled, out_socket: NodeSocket, state: ParserState) -> None: - if state.parse_surface: - c.write_normal(node.inputs[22]) - state.out_basecol = c.parse_vector_input(node.inputs[0]) - # subsurface = c.parse_vector_input(node.inputs[1]) - # subsurface_radius = c.parse_vector_input(node.inputs[2]) - # subsurface_color = c.parse_vector_input(node.inputs[3]) - if bpy.app.version < (4, 1, 0): + +if bpy.app.version < (3, 0, 0): + def parse_bsdfprincipled(node: bpy.types.ShaderNodeBsdfPrincipled, out_socket: NodeSocket, state: ParserState) -> None: + if state.parse_surface: + c.write_normal(node.inputs[20]) + state.out_basecol = c.parse_vector_input(node.inputs[0]) + state.out_metallic = c.parse_value_input(node.inputs[4]) + state.out_specular = c.parse_value_input(node.inputs[5]) + state.out_roughness = c.parse_value_input(node.inputs[7]) + if (node.inputs['Emission Strength'].is_linked or node.inputs['Emission Strength'].default_value != 0.0)\ + and (node.inputs['Emission'].is_linked or not mat_utils.equals_color_socket(node.inputs['Emission'], (0.0, 0.0, 0.0), comp_alpha=False)): + emission_col = c.parse_vector_input(node.inputs[17]) + emission_strength = c.parse_value_input(node.inputs[18]) + state.out_emission_col = '({0} * {1})'.format(emission_col, emission_strength) + mat_state.emission_type = mat_state.EmissionType.SHADED + else: + mat_state.emission_type = mat_state.EmissionType.NO_EMISSION + if state.parse_opacity: + state.out_ior = c.parse_value_input(node.inputs[14]) + state.out_opacity = c.parse_value_input(node.inputs[19]) +if bpy.app.version >= (3, 0, 0) and bpy.app.version <= (4, 1, 0): + def parse_bsdfprincipled(node: bpy.types.ShaderNodeBsdfPrincipled, out_socket: NodeSocket, state: ParserState) -> None: + if state.parse_surface: + c.write_normal(node.inputs[22]) + state.out_basecol = c.parse_vector_input(node.inputs[0]) + # subsurface = c.parse_vector_input(node.inputs[1]) + # subsurface_radius = c.parse_vector_input(node.inputs[2]) + # subsurface_color = c.parse_vector_input(node.inputs[3]) state.out_metallic = c.parse_value_input(node.inputs[6]) - else: - state.out_metallic = c.parse_value_input(node.inputs[1]) - state.out_specular = c.parse_value_input(node.inputs[7]) - # specular_tint = c.parse_vector_input(node.inputs[6]) - if bpy.app.version < (4, 1, 0): + state.out_specular = c.parse_value_input(node.inputs[7]) + # specular_tint = c.parse_vector_input(node.inputs[6]) state.out_roughness = c.parse_value_input(node.inputs[9]) - else: - state.out_roughness = c.parse_value_input(node.inputs[2]) - # aniso = c.parse_vector_input(node.inputs[8]) - # aniso_rot = c.parse_vector_input(node.inputs[9]) - # sheen = c.parse_vector_input(node.inputs[10]) - # sheen_tint = c.parse_vector_input(node.inputs[11]) - # clearcoat = c.parse_vector_input(node.inputs[12]) - # clearcoat_rough = c.parse_vector_input(node.inputs[13]) - # ior = c.parse_vector_input(node.inputs[14]) - # transmission = c.parse_vector_input(node.inputs[15]) - # transmission_roughness = c.parse_vector_input(node.inputs[16]) - if bpy.app.version < (4, 1, 0): + # aniso = c.parse_vector_input(node.inputs[8]) + # aniso_rot = c.parse_vector_input(node.inputs[9]) + # sheen = c.parse_vector_input(node.inputs[10]) + # sheen_tint = c.parse_vector_input(node.inputs[11]) + # clearcoat = c.parse_vector_input(node.inputs[12]) + # clearcoat_rough = c.parse_vector_input(node.inputs[13]) + # ior = c.parse_vector_input(node.inputs[14]) + # transmission = c.parse_vector_input(node.inputs[15]) + # transmission_roughness = c.parse_vector_input(node.inputs[16]) if (node.inputs['Emission Strength'].is_linked or node.inputs['Emission Strength'].default_value != 0.0)\ and (node.inputs['Emission'].is_linked or not mat_utils.equals_color_socket(node.inputs['Emission'], (0.0, 0.0, 0.0), comp_alpha=False)): emission_col = c.parse_vector_input(node.inputs[19]) @@ -110,7 +124,23 @@ def parse_bsdfprincipled(node: bpy.types.ShaderNodeBsdfPrincipled, out_socket: N mat_state.emission_type = mat_state.EmissionType.SHADED else: mat_state.emission_type = mat_state.EmissionType.NO_EMISSION - else: + # clearcoar_normal = c.parse_vector_input(node.inputs[21]) + # tangent = c.parse_vector_input(node.inputs[22]) + if state.parse_opacity: + state.out_ior = c.parse_value_input(node.inputs[16]) + if len(node.inputs) >= 21: + state.out_opacity = c.parse_value_input(node.inputs[21]) +if bpy.app.version > (4, 1, 0): + def parse_bsdfprincipled(node: bpy.types.ShaderNodeBsdfPrincipled, out_socket: NodeSocket, state: ParserState) -> None: + if state.parse_surface: + c.write_normal(node.inputs[5]) + state.out_basecol = c.parse_vector_input(node.inputs[0]) + subsurface = c.parse_value_input(node.inputs[8]) + subsurface_radius = c.parse_vector_input(node.inputs[9]) + subsurface_color = c.parse_vector_input(node.inputs[0]) + state.out_metallic = c.parse_value_input(node.inputs[1]) + state.out_specular = c.parse_value_input(node.inputs[7]) + state.out_roughness = c.parse_value_input(node.inputs[2]) if (node.inputs['Emission Strength'].is_linked or node.inputs['Emission Strength'].default_value != 0.0)\ and (node.inputs['Emission Color'].is_linked or not mat_utils.equals_color_socket(node.inputs['Emission Color'], (0.0, 0.0, 0.0), comp_alpha=False)): emission_col = c.parse_vector_input(node.inputs[27]) @@ -118,13 +148,10 @@ def parse_bsdfprincipled(node: bpy.types.ShaderNodeBsdfPrincipled, out_socket: N state.out_emission_col = '({0} * {1})'.format(emission_col, emission_strength) mat_state.emission_type = mat_state.EmissionType.SHADED else: - mat_state.emission_type = mat_state.EmissionType.NO_EMISSION - # clearcoar_normal = c.parse_vector_input(node.inputs[21]) - # tangent = c.parse_vector_input(node.inputs[22]) - if state.parse_opacity: - state.out_ior = c.parse_value_input(node.inputs[16]) - if len(node.inputs) >= 21: - state.out_opacity = c.parse_value_input(node.inputs[21]) + mat_state.emission_type = mat_state.EmissionType.NO_EMISSION + if state.parse_opacity: + state.out_ior = c.parse_value_input(node.inputs[3]) + state.out_opacity = c.parse_value_input(node.inputs[4]) def parse_bsdfdiffuse(node: bpy.types.ShaderNodeBsdfDiffuse, out_socket: NodeSocket, state: ParserState) -> None: if state.parse_surface: @@ -133,6 +160,7 @@ def parse_bsdfdiffuse(node: bpy.types.ShaderNodeBsdfDiffuse, out_socket: NodeSoc state.out_roughness = c.parse_value_input(node.inputs[1]) state.out_specular = '0.0' + if bpy.app.version < (4, 1, 0): def parse_bsdfglossy(node: bpy.types.ShaderNodeBsdfGlossy, out_socket: NodeSocket, state: ParserState) -> None: if state.parse_surface: @@ -141,6 +169,7 @@ def parse_bsdfglossy(node: bpy.types.ShaderNodeBsdfGlossy, out_socket: NodeSocke state.out_roughness = c.parse_value_input(node.inputs[1]) state.out_metallic = '1.0' + def parse_ambientocclusion(node: bpy.types.ShaderNodeAmbientOcclusion, out_socket: NodeSocket, state: ParserState) -> None: if state.parse_surface: # Single channel @@ -198,7 +227,10 @@ def parse_bsdfrefraction(node: bpy.types.ShaderNodeBsdfRefraction, out_socket: N def parse_subsurfacescattering(node: bpy.types.ShaderNodeSubsurfaceScattering, out_socket: NodeSocket, state: ParserState) -> None: if state.parse_surface: - c.write_normal(node.inputs[4]) + if bpy.app.version < (4, 1, 0): + c.write_normal(node.inputs[4]) + else: + c.write_normal(node.inputs[6]) state.out_basecol = c.parse_vector_input(node.inputs[0]) From 6875512936445355e2a5b5a480eb61ccd2e56d43 Mon Sep 17 00:00:00 2001 From: 1k8 Date: Mon, 12 Aug 2024 04:21:04 -0400 Subject: [PATCH 03/10] Update nodes_texture.py --- blender/arm/material/cycles_nodes/nodes_texture.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/blender/arm/material/cycles_nodes/nodes_texture.py b/blender/arm/material/cycles_nodes/nodes_texture.py index f5bcdc4298..ffa491be71 100644 --- a/blender/arm/material/cycles_nodes/nodes_texture.py +++ b/blender/arm/material/cycles_nodes/nodes_texture.py @@ -244,7 +244,6 @@ def parse_tex_magic(node: bpy.types.ShaderNodeTexMagic, out_socket: bpy.types.No return res - if bpy.app.version < (4, 1, 0): def parse_tex_musgrave(node: bpy.types.ShaderNodeTexMusgrave, out_socket: bpy.types.NodeSocket, state: ParserState) -> Union[floatstr, vec3str]: state.curshader.add_function(c_functions.str_tex_musgrave) @@ -253,13 +252,13 @@ def parse_tex_musgrave(node: bpy.types.ShaderNodeTexMusgrave, out_socket: bpy.ty co = c.parse_vector_input(node.inputs[0]) else: co = 'bposition' - + scale = c.parse_value_input(node.inputs['Scale']) # detail = c.parse_value_input(node.inputs[2]) # distortion = c.parse_value_input(node.inputs[3]) - + res = f'tex_musgrave_f({co} * {scale} * 0.5)' - + return res From 0429278e97ff58fe3c20827201377f79b89d00cb Mon Sep 17 00:00:00 2001 From: 1k8 Date: Mon, 12 Aug 2024 04:22:18 -0400 Subject: [PATCH 04/10] Update node_meta.py --- blender/arm/material/node_meta.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/blender/arm/material/node_meta.py b/blender/arm/material/node_meta.py index 690a84e1c8..9d1a468914 100644 --- a/blender/arm/material/node_meta.py +++ b/blender/arm/material/node_meta.py @@ -76,13 +76,11 @@ class MaterialNodeMeta: 'BLACKBODY': MaterialNodeMeta(parse_func=nodes_converter.parse_blackbody), 'CLAMP': MaterialNodeMeta(parse_func=nodes_converter.parse_clamp), 'COMBHSV': MaterialNodeMeta(parse_func=nodes_converter.parse_combhsv), - 'COMBINE_COLOR': MaterialNodeMeta(parse_func=nodes_converter.parse_combine_color), 'COMBRGB': MaterialNodeMeta(parse_func=nodes_converter.parse_combrgb), 'COMBXYZ': MaterialNodeMeta(parse_func=nodes_converter.parse_combxyz), 'MAP_RANGE': MaterialNodeMeta(parse_func=nodes_converter.parse_maprange), 'MATH': MaterialNodeMeta(parse_func=nodes_converter.parse_math), 'RGBTOBW': MaterialNodeMeta(parse_func=nodes_converter.parse_rgbtobw), - 'SEPARATE_COLOR': MaterialNodeMeta(parse_func=nodes_converter.parse_separate_color), 'SEPHSV': MaterialNodeMeta(parse_func=nodes_converter.parse_sephsv), 'SEPRGB': MaterialNodeMeta(parse_func=nodes_converter.parse_seprgb), 'SEPXYZ': MaterialNodeMeta(parse_func=nodes_converter.parse_sepxyz), @@ -201,6 +199,9 @@ class MaterialNodeMeta: ) } +if bpy.app.version > (3, 2, 0): + ALL_NODES['SEPARATE_COLOR'] = MaterialNodeMeta(parse_func=nodes_converter.parse_separate_color) + ALL_NODES['COMBINE_COLOR'] = MaterialNodeMeta(parse_func=nodes_converter.parse_combine_color) if bpy.app.version < (4, 1, 0): ALL_NODES['BSDF_GLOSSY'] = MaterialNodeMeta(parse_func=nodes_shader.parse_bsdfglossy) ALL_NODES['BSDF_VELVET'] = MaterialNodeMeta(parse_func=nodes_shader.parse_bsdfvelvet) From 9284fb412e4e430bbd6314ac32cf0328dc46172b Mon Sep 17 00:00:00 2001 From: 1k8 Date: Mon, 12 Aug 2024 04:28:27 -0400 Subject: [PATCH 05/10] Update exporter.py --- blender/arm/exporter.py | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/blender/arm/exporter.py b/blender/arm/exporter.py index 7e3de302a6..d250974bc0 100644 --- a/blender/arm/exporter.py +++ b/blender/arm/exporter.py @@ -255,6 +255,8 @@ def export_bone(self, armature, bone: bpy.types.Bone, o, action: bpy.types.Actio o['type'] = STRUCT_IDENTIFIER[bobject_ref["objectType"].value] o['name'] = bobject_ref["structName"] self.export_bone_transform(armature, bone, o, action) + self.export_bone_layers(armature, bone, o) + o['bone_length'] = bone.length o['children'] = [] for sub_bobject in bone.children: @@ -274,6 +276,11 @@ def export_pose_markers(oanim, action): oanim['marker_frames'].append(int(pos_marker.frame)) oanim['marker_names'].append(pos_marker.name) + @staticmethod + def export_root_motion(oanim, action): + oanim['root_motion_pos'] = action.arm_root_motion_pos + oanim['root_motion_rot'] = action.arm_root_motion_rot + @staticmethod def calculate_anim_frame_range(action: bpy.types.Action) -> Tuple[int, int]: """Calculates the required frame range of the given action by @@ -472,6 +479,16 @@ def export_bone_transform(self, armature: bpy.types.Object, bone: bpy.types.Bone out_track['frames'].append(i - begin_frame) self.bone_tracks.append((out_track['values'], pose_bone)) + + def export_bone_layers(self, armature: bpy.types.Object, bone: bpy.types.Bone, o): + layers = [] + if bpy.app.version < (4, 0, 0): + for layer in bone.layers: + layers.append(layer) + else: + for bonecollection in armature.data.collections: + layers.append(bonecollection.is_visible) + o['bone_layers'] = layers def use_default_material(self, bobject: bpy.types.Object, o): if arm.utils.export_bone_data(bobject): @@ -763,10 +780,15 @@ def export_object(self, bobject: bpy.types.Object, out_parent: Dict = None) -> N if bobject.hide_render or not bobject.arm_visible: out_object['visible'] = False - if not bobject.visible_camera: - out_object['visible_mesh'] = False - if not bobject.visible_shadow: - out_object['visible_shadow'] = False + if bpy.app.version < (3, 0, 0): + if not bobject.cycles_visibility: + out_object['visible_mesh'] = False + out_object['visible_shadow'] = False + else: + if not bobject.visible_camera: + out_object['visible_mesh'] = False + if not bobject.visible_shadow: + out_object['visible_shadow'] = False if not bobject.arm_spawn: out_object['spawn'] = False @@ -1045,6 +1067,7 @@ def export_object(self, bobject: bpy.types.Object, out_parent: Dict = None) -> N self.write_bone_matrices(bpy.context.scene, action) if len(bones) > 0 and 'anim' in bones[0]: self.export_pose_markers(bones[0]['anim'], original_action) + self.export_root_motion(bones[0]['anim'], original_action) # Save action separately action_obj = {'name': aname, 'objects': bones} arm.utils.write_arm(fp, action_obj) From c297428457e015d202eb58b07d92ae2763716fd0 Mon Sep 17 00:00:00 2001 From: 1k8 Date: Mon, 12 Aug 2024 04:35:56 -0400 Subject: [PATCH 06/10] Update exporter.py --- blender/arm/exporter.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/blender/arm/exporter.py b/blender/arm/exporter.py index d250974bc0..39a26feaf6 100644 --- a/blender/arm/exporter.py +++ b/blender/arm/exporter.py @@ -255,8 +255,8 @@ def export_bone(self, armature, bone: bpy.types.Bone, o, action: bpy.types.Actio o['type'] = STRUCT_IDENTIFIER[bobject_ref["objectType"].value] o['name'] = bobject_ref["structName"] self.export_bone_transform(armature, bone, o, action) - self.export_bone_layers(armature, bone, o) - o['bone_length'] = bone.length + #self.export_bone_layers(armature, bone, o) + #o['bone_length'] = bone.length o['children'] = [] for sub_bobject in bone.children: @@ -276,10 +276,10 @@ def export_pose_markers(oanim, action): oanim['marker_frames'].append(int(pos_marker.frame)) oanim['marker_names'].append(pos_marker.name) - @staticmethod - def export_root_motion(oanim, action): - oanim['root_motion_pos'] = action.arm_root_motion_pos - oanim['root_motion_rot'] = action.arm_root_motion_rot + #@staticmethod + #def export_root_motion(oanim, action): + # oanim['root_motion_pos'] = action.arm_root_motion_pos + # oanim['root_motion_rot'] = action.arm_root_motion_rot @staticmethod def calculate_anim_frame_range(action: bpy.types.Action) -> Tuple[int, int]: @@ -480,15 +480,15 @@ def export_bone_transform(self, armature: bpy.types.Object, bone: bpy.types.Bone self.bone_tracks.append((out_track['values'], pose_bone)) - def export_bone_layers(self, armature: bpy.types.Object, bone: bpy.types.Bone, o): - layers = [] - if bpy.app.version < (4, 0, 0): - for layer in bone.layers: - layers.append(layer) - else: - for bonecollection in armature.data.collections: - layers.append(bonecollection.is_visible) - o['bone_layers'] = layers + #def export_bone_layers(self, armature: bpy.types.Object, bone: bpy.types.Bone, o): + # layers = [] + # if bpy.app.version < (4, 0, 0): + # for layer in bone.layers: + # layers.append(layer) + # else: + # for bonecollection in armature.data.collections: + # layers.append(bonecollection.is_visible) + # o['bone_layers'] = layers def use_default_material(self, bobject: bpy.types.Object, o): if arm.utils.export_bone_data(bobject): @@ -1067,7 +1067,7 @@ def export_object(self, bobject: bpy.types.Object, out_parent: Dict = None) -> N self.write_bone_matrices(bpy.context.scene, action) if len(bones) > 0 and 'anim' in bones[0]: self.export_pose_markers(bones[0]['anim'], original_action) - self.export_root_motion(bones[0]['anim'], original_action) + #self.export_root_motion(bones[0]['anim'], original_action) # Save action separately action_obj = {'name': aname, 'objects': bones} arm.utils.write_arm(fp, action_obj) From 58a83af34d6c7980232a16ef4ece888f45e86a1b Mon Sep 17 00:00:00 2001 From: 1k8 Date: Mon, 12 Aug 2024 04:46:10 -0400 Subject: [PATCH 07/10] Update utils.py --- blender/arm/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blender/arm/utils.py b/blender/arm/utils.py index c6a2b3cf45..a2f0b4a120 100644 --- a/blender/arm/utils.py +++ b/blender/arm/utils.py @@ -760,7 +760,7 @@ def get_render_resolution(scene): return int(render.resolution_x * scale), int(render.resolution_y * scale) def get_texture_quality_percentage() -> int: - return int(bpy.data.worlds["Arm"].arm_texture_quality * 100) + return int(bpy.data.worlds['Arm'].arm_texture_quality * 100) def get_project_scene_name(): return get_active_scene().name From d3edccdc94d171529d0b3f05d300df86c1a810ad Mon Sep 17 00:00:00 2001 From: 1k8 Date: Mon, 12 Aug 2024 04:46:25 -0400 Subject: [PATCH 08/10] Update props_ui.py --- blender/arm/props_ui.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/blender/arm/props_ui.py b/blender/arm/props_ui.py index ed5652daf9..8f69be126b 100644 --- a/blender/arm/props_ui.py +++ b/blender/arm/props_ui.py @@ -724,7 +724,10 @@ def draw(self, context): if state.proc_play is None and state.proc_build is None: row.operator("arm.play", icon="PLAY") else: - row.operator("arm.stop", icon="MESH_PLANE") + if bpy.app.version < (3, 0, 0): + row.operator("arm.stop", icon="CANCEL", text="") + else: + row.operator("arm.stop", icon="SEQUENCE_COLOR_01", text="") row.operator("arm.clean_menu", icon="BRUSH_DATA") col = layout.box().column() From 5db2d7e828a9602187ed7ea49adcedd2368b6bed Mon Sep 17 00:00:00 2001 From: 1k8 Date: Mon, 12 Aug 2024 10:47:05 -0400 Subject: [PATCH 09/10] Update exporter.py --- blender/arm/exporter.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/blender/arm/exporter.py b/blender/arm/exporter.py index 39a26feaf6..27c64399a7 100644 --- a/blender/arm/exporter.py +++ b/blender/arm/exporter.py @@ -255,8 +255,6 @@ def export_bone(self, armature, bone: bpy.types.Bone, o, action: bpy.types.Actio o['type'] = STRUCT_IDENTIFIER[bobject_ref["objectType"].value] o['name'] = bobject_ref["structName"] self.export_bone_transform(armature, bone, o, action) - #self.export_bone_layers(armature, bone, o) - #o['bone_length'] = bone.length o['children'] = [] for sub_bobject in bone.children: @@ -276,11 +274,6 @@ def export_pose_markers(oanim, action): oanim['marker_frames'].append(int(pos_marker.frame)) oanim['marker_names'].append(pos_marker.name) - #@staticmethod - #def export_root_motion(oanim, action): - # oanim['root_motion_pos'] = action.arm_root_motion_pos - # oanim['root_motion_rot'] = action.arm_root_motion_rot - @staticmethod def calculate_anim_frame_range(action: bpy.types.Action) -> Tuple[int, int]: """Calculates the required frame range of the given action by @@ -479,16 +472,6 @@ def export_bone_transform(self, armature: bpy.types.Object, bone: bpy.types.Bone out_track['frames'].append(i - begin_frame) self.bone_tracks.append((out_track['values'], pose_bone)) - - #def export_bone_layers(self, armature: bpy.types.Object, bone: bpy.types.Bone, o): - # layers = [] - # if bpy.app.version < (4, 0, 0): - # for layer in bone.layers: - # layers.append(layer) - # else: - # for bonecollection in armature.data.collections: - # layers.append(bonecollection.is_visible) - # o['bone_layers'] = layers def use_default_material(self, bobject: bpy.types.Object, o): if arm.utils.export_bone_data(bobject): @@ -1067,7 +1050,6 @@ def export_object(self, bobject: bpy.types.Object, out_parent: Dict = None) -> N self.write_bone_matrices(bpy.context.scene, action) if len(bones) > 0 and 'anim' in bones[0]: self.export_pose_markers(bones[0]['anim'], original_action) - #self.export_root_motion(bones[0]['anim'], original_action) # Save action separately action_obj = {'name': aname, 'objects': bones} arm.utils.write_arm(fp, action_obj) From 97feaf22f39f569252b233a28c3e552aa9cea80f Mon Sep 17 00:00:00 2001 From: 1k8 Date: Tue, 13 Aug 2024 03:22:25 -0400 Subject: [PATCH 10/10] Update WebSocket.hx --- Sources/armory/network/WebSocket.hx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/armory/network/WebSocket.hx b/Sources/armory/network/WebSocket.hx index 1946e03123..622e59c926 100644 --- a/Sources/armory/network/WebSocket.hx +++ b/Sources/armory/network/WebSocket.hx @@ -109,7 +109,7 @@ class WebSocket { _onmessage = value; _ws.onmessage = function(message: Dynamic) { if (_onmessage != null) { - if (Std.isOfType(message.data, JsBuffer)) { + if (message.data is JsBuffer) { var buffer = new Buffer(); buffer.writeBytes(Bytes.ofData(message.data)); _onmessage(BytesMessage(buffer)); @@ -141,10 +141,10 @@ class WebSocket { } public function send(msg:Any) { - if (Std.isOfType(msg, Bytes)) { + if (msg is Bytes) { var bytes = cast(msg, Bytes); _ws.send(bytes.getData()); - } else if (Std.isOfType(msg, Buffer)) { + } else if (msg is Buffer) { var buffer = cast(msg, Buffer); _ws.send(buffer.readAllAvailableBytes().getData()); } else {