From 031458bfc8c6d2366b0c89d0d52304c8ecae1cb0 Mon Sep 17 00:00:00 2001 From: yyc12345 Date: Sat, 7 Nov 2020 19:32:07 +0800 Subject: [PATCH] fix add_floor material error --- ballance_blender_plugin/add_floor.py | 6 +- ballance_blender_plugin/config.py | 8 ++ ballance_blender_plugin/json/BasicBlock.json | 98 ++++++++++---------- 3 files changed, 60 insertions(+), 52 deletions(-) diff --git a/ballance_blender_plugin/add_floor.py b/ballance_blender_plugin/add_floor.py index 2e1b11e..f09e763 100644 --- a/ballance_blender_plugin/add_floor.py +++ b/ballance_blender_plugin/add_floor.py @@ -206,9 +206,9 @@ def create_or_get_material(material_name): # write custom property # WARNING: this data is shared with BallanceVirtoolsPlugin - mapping_BM.cpp - fix_blender_texture m['virtools-ambient'] = (0.0, 0.0, 0.0) - m['virtools-diffuse'] = (122 / 255.0, 122 / 255.0, 122 / 255.0) if material_name == 'FloorSide' else (1.0, 1.0, 1.0) - m['virtools-specular'] = (0.0, 0.0, 0.0) if material_name == 'FloorSide' else (80 / 255.0, 80 / 255.0, 80 / 255.0) - m['virtools-emissive'] = (104 / 255.0, 104 / 255.0, 104 / 255.0) if material_name == 'FloorSide' else (0.0, 0.0, 0.0) + m['virtools-diffuse'] = (122 / 255.0, 122 / 255.0, 122 / 255.0) if material_name in config.floor_side_material_list else (1.0, 1.0, 1.0) + m['virtools-specular'] = (0.0, 0.0, 0.0) if material_name in config.floor_side_material_list else (80 / 255.0, 80 / 255.0, 80 / 255.0) + m['virtools-emissive'] = (104 / 255.0, 104 / 255.0, 104 / 255.0) if material_name in config.floor_side_material_list else (0.0, 0.0, 0.0) m['virtools-power'] = 0.0 return m diff --git a/ballance_blender_plugin/config.py b/ballance_blender_plugin/config.py index 9e89f17..39fd489 100644 --- a/ballance_blender_plugin/config.py +++ b/ballance_blender_plugin/config.py @@ -146,7 +146,9 @@ floor_expand_direction_map = { floor_texture_corresponding_map = { "FloorSide": "Floor_Side.bmp", "FloorTopBorder": "Floor_Top_Border.bmp", + "FloorTopBorder_ForSide": "Floor_Top_Border.bmp", "FloorTopBorderless": "Floor_Top_Borderless.bmp", + "FloorTopBorderless_ForSide": "Floor_Top_Borderless.bmp", "FloorTopFlat": "Floor_Top_Flat.bmp", "FloorTopProfil": "Floor_Top_Profil.bmp", "FloorTopProfilFlat": "Floor_Top_ProfilFlat.bmp", @@ -155,6 +157,12 @@ floor_texture_corresponding_map = { "BallStone": "Ball_Stone.bmp" } +floor_side_material_list = [ + "FloorSide", + "FloorTopBorder_ForSide", + "FloorTopBorderless_ForSide" +] + floor_block_dict = {} floor_basic_block_list = [] floor_derived_block_list = [] diff --git a/ballance_blender_plugin/json/BasicBlock.json b/ballance_blender_plugin/json/BasicBlock.json index d75b709..6042c55 100644 --- a/ballance_blender_plugin/json/BasicBlock.json +++ b/ballance_blender_plugin/json/BasicBlock.json @@ -57,7 +57,7 @@ "P2": 2, "P3": 1, "P4": 0, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -81,7 +81,7 @@ "P2": 1, "P3": 2, "P4": 3, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -105,7 +105,7 @@ "P2": 1, "P3": 2, "P4": 3, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -129,7 +129,7 @@ "P2": 1, "P3": 2, "P4": 3, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -186,7 +186,7 @@ "P2": 3, "P3": 4, "P4": 5, - "Textures": "FloorTopBorder" + "Textures": "FloorTopBorder_ForSide" }, { "Type": "RECTANGLE", @@ -194,7 +194,7 @@ "P2": 2, "P3": 1, "P4": 0, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] } @@ -257,7 +257,7 @@ "P2": 2, "P3": 1, "P4": 0, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -281,7 +281,7 @@ "P2": 2, "P3": 1, "P4": 0, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -305,7 +305,7 @@ "P2": 1, "P3": 2, "P4": 3, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -329,7 +329,7 @@ "P2": 1, "P3": 2, "P4": 3, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -386,7 +386,7 @@ "P2": 3, "P3": 4, "P4": 5, - "Textures": "FloorTopBorder" + "Textures": "FloorTopBorder_ForSide" }, { "Type": "RECTANGLE", @@ -394,7 +394,7 @@ "P2": 2, "P3": 1, "P4": 0, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] } @@ -465,7 +465,7 @@ "P2": 2, "P3": 1, "P4": 0, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -513,7 +513,7 @@ "P2": 1, "P3": 2, "P4": 3, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -537,7 +537,7 @@ "P2": 1, "P3": 2, "P4": 3, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -591,7 +591,7 @@ "P2": 3, "P3": 4, "P4": 5, - "Textures": "FloorTopBorder" + "Textures": "FloorTopBorder_ForSide" }, { "Type": "RECTANGLE", @@ -599,7 +599,7 @@ "P2": 2, "P3": 1, "P4": 0, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -631,7 +631,7 @@ "P2": 3, "P3": 4, "P4": 5, - "Textures": "FloorTopBorder" + "Textures": "FloorTopBorder_ForSide" }, { "Type": "RECTANGLE", @@ -639,7 +639,7 @@ "P2": 2, "P3": 1, "P4": 0, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] } @@ -710,7 +710,7 @@ "P2": 2, "P3": 1, "P4": 0, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -758,7 +758,7 @@ "P2": 1, "P3": 2, "P4": 3, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -782,7 +782,7 @@ "P2": 1, "P3": 2, "P4": 3, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -836,7 +836,7 @@ "P2": 3, "P3": 4, "P4": 5, - "Textures": "FloorTopBorder" + "Textures": "FloorTopBorder_ForSide" }, { "Type": "RECTANGLE", @@ -844,7 +844,7 @@ "P2": 2, "P3": 1, "P4": 0, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -876,7 +876,7 @@ "P2": 3, "P3": 4, "P4": 5, - "Textures": "FloorTopBorder" + "Textures": "FloorTopBorder_ForSide" }, { "Type": "RECTANGLE", @@ -884,7 +884,7 @@ "P2": 2, "P3": 1, "P4": 0, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] } @@ -955,7 +955,7 @@ "P2": 2, "P3": 1, "P4": 0, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -979,7 +979,7 @@ "P2": 1, "P3": 2, "P4": 3, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -1003,7 +1003,7 @@ "P2": 1, "P3": 2, "P4": 3, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -1027,7 +1027,7 @@ "P2": 1, "P3": 2, "P4": 3, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -1051,7 +1051,7 @@ "P2": 1, "P3": 2, "P4": 3, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -1126,7 +1126,7 @@ "P2": 2, "P3": 1, "P4": 0, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -1150,7 +1150,7 @@ "P2": 1, "P3": 2, "P4": 3, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -1174,7 +1174,7 @@ "P2": 1, "P3": 2, "P4": 3, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -1198,7 +1198,7 @@ "P2": 1, "P3": 2, "P4": 3, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -1222,7 +1222,7 @@ "P2": 1, "P3": 2, "P4": 3, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -1289,7 +1289,7 @@ "P2": 2, "P3": 1, "P4": 0, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -1313,7 +1313,7 @@ "P2": 1, "P3": 2, "P4": 3, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -1337,7 +1337,7 @@ "P2": 1, "P3": 2, "P4": 3, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -1361,7 +1361,7 @@ "P2": 1, "P3": 2, "P4": 3, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -1385,7 +1385,7 @@ "P2": 1, "P3": 2, "P4": 3, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -2236,7 +2236,7 @@ "P2": 2, "P3": 1, "P4": 0, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -2266,7 +2266,7 @@ "P2": 1, "P3": 2, "P4": 3, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" }, { "Type": "RECTANGLE", @@ -2274,7 +2274,7 @@ "P2": 4, "P3": 3, "P4": 2, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -2322,7 +2322,7 @@ "P2": 1, "P3": 2, "P4": 3, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -2377,7 +2377,7 @@ "P2": 1, "P3": 2, "P4": 3, - "Textures": "FloorTopBorder" + "Textures": "FloorTopBorder_ForSide" }, { "Type": "RECTANGLE", @@ -2385,7 +2385,7 @@ "P2": 4, "P3": 3, "P4": 2, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }, @@ -2416,7 +2416,7 @@ "P2": 2, "P3": 1, "P4": 0, - "Textures": "FloorTopBorder" + "Textures": "FloorTopBorder_ForSide" }, { "Type": "RECTANGLE", @@ -2424,7 +2424,7 @@ "P2": 3, "P3": 4, "P4": 5, - "Textures": "FloorTopBorderless" + "Textures": "FloorTopBorderless_ForSide" } ] }