revert some changes about prev commit

This commit is contained in:
yyc12345 2023-11-14 21:37:29 +08:00
parent 1f0444009f
commit fd17d3b5c9
2 changed files with 7 additions and 6 deletions

View File

@ -481,7 +481,8 @@ def apply_to_blender_material(mtl: bpy.types.Material):
mtl.specular_color = rawdata.mSpecular.to_const_rgb() mtl.specular_color = rawdata.mSpecular.to_const_rgb()
bnode.inputs["Emission"].default_value = rawdata.mEmissive.to_const_rgba() # too shiny, disabled.
# bnode.inputs["Emission"].default_value = rawdata.mEmissive.to_const_rgba()
mtl.specular_intensity = rawdata.mSpecularPower mtl.specular_intensity = rawdata.mSpecularPower
bnode.inputs["Specular"].default_value = UTIL_functions.clamp_float( bnode.inputs["Specular"].default_value = UTIL_functions.clamp_float(

View File

@ -480,15 +480,15 @@ class MeshWriter():
# validate mesh. # validate mesh.
# it is IMPORTANT that do NOT delete custom data # it is IMPORTANT that do NOT delete custom data
# because we need use these data to set custom split normal later # because we need use these data to set custom split normal later
validation_err: bool = self.__mAssocMesh.validate(clean_customdata = False) self.__mAssocMesh.validate(clean_customdata = False)
# update mesh without mesh calc # update mesh without mesh calc
self.__mAssocMesh.update(calc_edges = False, calc_edges_loose = False) self.__mAssocMesh.update(calc_edges = False, calc_edges_loose = False)
# set custom split normal data # set custom split normal data
# if the validate() change the mesh, skip this and output error. # if the validate() change the mesh, skip this and output error.
# this should not happend in normal case, # this change is detected by the loops count changes, not the return value of validate(). because only the changes of loops can let following throw errors.
# just a stupid patch for "线框Level1.Level.NMO" loading. # this should not happend in normal case, just a stupid patch for "线框Level1.Level.NMO" loading.
if not validation_err: if len(self.__mAssocMesh.loops) == len(self.__mFacePosIndices):
self.__mAssocMesh.normals_split_custom_set( self.__mAssocMesh.normals_split_custom_set(
tuple(_nest_custom_split_normal(self.__mFaceNmlIndices, self.__mVertexNormal)) tuple(_nest_custom_split_normal(self.__mFaceNmlIndices, self.__mVertexNormal))
) )