forked from LeenkxTeam/LNXSDK
		
	merge upstream
This commit is contained in:
		| @ -254,9 +254,10 @@ def parse_particleinfo(node: bpy.types.ShaderNodeParticleInfo, out_socket: bpy.t | ||||
|         c.particle_info['index'] = True | ||||
|         return 'p_index' if particles_on else '0.0' | ||||
|  | ||||
|     # TODO: Random | ||||
|     # Random | ||||
|     if out_socket == node.outputs[1]: | ||||
|         return '0.0' | ||||
|         c.particle_info['random'] = True | ||||
|         return 'p_random' if particles_on else '0.0' | ||||
|  | ||||
|     # Age | ||||
|     elif out_socket == node.outputs[2]: | ||||
| @ -276,7 +277,7 @@ def parse_particleinfo(node: bpy.types.ShaderNodeParticleInfo, out_socket: bpy.t | ||||
|     # Size | ||||
|     elif out_socket == node.outputs[5]: | ||||
|         c.particle_info['size'] = True | ||||
|         return '1.0' | ||||
|         return 'p_size' if particles_on else '1.0' | ||||
|  | ||||
|     # Velocity | ||||
|     elif out_socket == node.outputs[6]: | ||||
|  | ||||
| @ -76,7 +76,7 @@ def parse_addshader(node: bpy.types.ShaderNodeAddShader, out_socket: NodeSocket, | ||||
|         state.out_ior = '({0} * 0.5 + {1} * 0.5)'.format(ior1, ior2) | ||||
|  | ||||
|  | ||||
| if bpy.app.version < (3, 0, 0): | ||||
| if bpy.app.version < (2, 92, 0): | ||||
|     def parse_bsdfprincipled(node: bpy.types.ShaderNodeBsdfPrincipled, out_socket: NodeSocket, state: ParserState) -> None: | ||||
|         if state.parse_surface: | ||||
|             c.write_normal(node.inputs[20]) | ||||
| @ -84,18 +84,20 @@ if bpy.app.version < (3, 0, 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)): | ||||
|             if 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) | ||||
|                 state.out_emission_col = emission_col | ||||
|                 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): | ||||
|             # In Blender 2.83, Alpha socket is at index 18, not 19 | ||||
|             if 'Alpha' in node.inputs: | ||||
|                 state.out_opacity = c.parse_value_input(node.inputs['Alpha']) | ||||
|             else: | ||||
|                 state.out_opacity = '1.0' | ||||
| if bpy.app.version >= (2, 92, 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]) | ||||
|  | ||||
		Reference in New Issue
	
	Block a user