From 9861fc9fc21ad1a3e6c48b57baa51b67566702f1 Mon Sep 17 00:00:00 2001 From: Simarilius Date: Thu, 16 Nov 2023 00:21:04 +0000 Subject: [PATCH] fixed the distortion, introduced random room selection --- .../interior_mapping_nodegroups.py | 27 +++++++++++++------ .../window_parallax_interior_proxy.py | 25 +++++++++++++++-- 2 files changed, 42 insertions(+), 10 deletions(-) diff --git a/i_scene_cp77_gltf/material_types/interior_mapping_nodegroups.py b/i_scene_cp77_gltf/material_types/interior_mapping_nodegroups.py index 0f79581..84e6fad 100644 --- a/i_scene_cp77_gltf/material_types/interior_mapping_nodegroups.py +++ b/i_scene_cp77_gltf/material_types/interior_mapping_nodegroups.py @@ -1058,14 +1058,25 @@ def andrew_willmotts_plane_interior_mapping_node_group(): andrew_willmotts_interior_mapping.links.new(AR_div.outputs[0], math_006.inputs[1]) andrew_willmotts_interior_mapping.links.new(AR_div.outputs[0], math_007.inputs[1]) - AddGI = create_node(andrew_willmotts_interior_mapping.nodes,"NodeGroupInput",(2379., 840.)) - AddCXYZ = create_node(andrew_willmotts_interior_mapping.nodes,"ShaderNodeCombineXYZ",(2677., 774.)) - AddCXYZ.inputs[0].default_value=1.0 - Add_VM = create_node(andrew_willmotts_interior_mapping.nodes,"ShaderNodeVectorMath",(2967., 803.), operation='DIVIDE') - Add_VM.inputs[0].default_value=(0.5,0,0.5) - andrew_willmotts_interior_mapping.links.new(AddGI.outputs[4], AddCXYZ.inputs[2]) - andrew_willmotts_interior_mapping.links.new(AddCXYZ.outputs[0], Add_VM.inputs[1]) - #andrew_willmotts_interior_mapping.links.new(Add_VM.outputs[0], vector_math_011.inputs[1]) + AddGI = create_node(andrew_willmotts_interior_mapping.nodes,"NodeGroupInput",(10., 10.)) + AR_div2 = create_node(andrew_willmotts_interior_mapping.nodes,"ShaderNodeMath",(10, 10.), operation='DIVIDE') + AR_div2.inputs[0].default_value = -1 + AddCXYZ = create_node(andrew_willmotts_interior_mapping.nodes,"ShaderNodeCombineXYZ",(10., 10.)) + AddCXYZ.inputs[0].default_value=-1.0 + AddCXYZ.inputs[1].default_value=-1.0 + AddCXYZ.inputs[2].default_value=-1.0 + AddGI.parent = frame_001 + AR_div2.parent = frame_001 + AddCXYZ.parent = frame_001 + AddGI.location=(7080., 1490.) + AR_div2.location=(7245, 1490.) + AddCXYZ.location= (7429., 1490.) + + andrew_willmotts_interior_mapping.links.new(AddGI.outputs[4], AR_div2.inputs[1]) + andrew_willmotts_interior_mapping.links.new(AR_div2.outputs[0], AddCXYZ.inputs[0]) + andrew_willmotts_interior_mapping.links.new(AR_div2.outputs[0], AddCXYZ.inputs[1]) + andrew_willmotts_interior_mapping.links.new(AR_div2.outputs[0], AddCXYZ.inputs[2]) + andrew_willmotts_interior_mapping.links.new(AddCXYZ.outputs[0], vector_math_001.inputs[1]) return andrew_willmotts_interior_mapping diff --git a/i_scene_cp77_gltf/material_types/window_parallax_interior_proxy.py b/i_scene_cp77_gltf/material_types/window_parallax_interior_proxy.py index f818533..8d65ddb 100644 --- a/i_scene_cp77_gltf/material_types/window_parallax_interior_proxy.py +++ b/i_scene_cp77_gltf/material_types/window_parallax_interior_proxy.py @@ -34,7 +34,7 @@ def create(self,Data,Mat): roomWidth = CreateShaderNodeValue(CurMat,Data["roomWidth"],-800, -100,"roomWidth") # roomHeight if 'roomHeight' in Data: - roomHeight = CreateShaderNodeValue(CurMat,Data["roomHeight"],-8000, -200,"roomHeight") + roomHeight = CreateShaderNodeValue(CurMat,Data["roomHeight"],-800, -200,"roomHeight") # roomDepth if 'roomDepth' in Data: roomDepth = CreateShaderNodeValue(CurMat,Data["roomDepth"],-800, -300,"roomDepth") @@ -70,6 +70,27 @@ def create(self,Data,Mat): CurMat.links.new(InteriorMapping.outputs[0],flipbook.inputs[0]) CurMat.links.new(flipbook.outputs[0],bColNode.inputs[0]) CurMat.links.new(bColNode.outputs[0],CurMat.nodes['Material Output'].inputs[0]) + + #Randomise Rooms + WhiteNoiseTexture = create_node(CurMat.nodes,"ShaderNodeTexWhiteNoise",(-1077.558349609375, 946.2904052734375), label="White Noise Texture") + WhiteNoiseTexture.noise_dimensions='1D' + SeparateXYZ = create_node(CurMat.nodes,"ShaderNodeSeparateXYZ",(-1434.1156005859375, 899.5537719726562), label="Separate XYZ") + Math = create_node(CurMat.nodes,"ShaderNodeMath",(-1245.8779296875, 950.3339233398438), operation='FLOOR', label="Math") + Mathb = create_node(CurMat.nodes,"ShaderNodeMath",(-1245.8779296875, 930.3339233398438), operation='FLOOR', label="Mathb") + Mathc = create_node(CurMat.nodes,"ShaderNodeMath",(-1205.8779296875, 930.3339233398438), operation='MULTIPLY', label="Mathc") + Math002 = create_node(CurMat.nodes,"ShaderNodeMath",(-891.7330322265625, 936.3861694335938), operation='MULTIPLY', label="Math.002") + Math002.inputs[1].default_value=5 + Math001 = create_node(CurMat.nodes,"ShaderNodeMath",(-715.7330322265625, 918.6345825195312), operation='FLOOR', label="Math.001") + + CurMat.links.new(UV.outputs['UV'], SeparateXYZ.inputs[0]) + CurMat.links.new(SeparateXYZ.outputs['X'], Math.inputs[0]) + CurMat.links.new(SeparateXYZ.outputs['Y'], Mathb.inputs[0]) + CurMat.links.new(Math.outputs['Value'], Mathc.inputs[0]) + CurMat.links.new(Mathb.outputs['Value'], Mathc.inputs[1]) + CurMat.links.new(Mathc.outputs['Value'], WhiteNoiseTexture.inputs[1]) + CurMat.links.new(WhiteNoiseTexture.outputs['Value'], Math002.inputs[0]) + CurMat.links.new(Math002.outputs['Value'], Math001.inputs[0]) + CurMat.links.new(Math001.outputs['Value'], flipbook.inputs[1]) # LightsTempVariationAtNight # AmountTurnOffAtNight # TintColorAtNight @@ -88,4 +109,4 @@ def create(self,Data,Mat): # CurtainMaxCover # CurtainCoverRandomize # CurtainAlpha - \ No newline at end of file +