Skip to content

Commit 470a589

Browse files
committed
rename attributes with prefix
1 parent 1618e86 commit 470a589

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

simloader/importer.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import meshio
33
import traceback
44
import fileseq
5-
from .utils import show_message_box, reserved_word_check
5+
from .utils import show_message_box
66
import numpy as np
77
from mathutils import Matrix
88
import additional_file_formats
@@ -100,7 +100,7 @@ def update_mesh(meshio_mesh, mesh):
100100
# copy attributes
101101
attributes = mesh.attributes
102102
for k, v in meshio_mesh.point_data.items():
103-
k = reserved_word_check(k)
103+
k = "simloader_" + k
104104
attribute = None
105105
if k not in attributes:
106106
if len(v.shape) == 1:
@@ -129,15 +129,13 @@ def update_mesh(meshio_mesh, mesh):
129129
name_string = 'vector'
130130

131131
attribute.data.foreach_set(name_string, v.ravel())
132-
133132

134133
# set as split norm
135-
if mesh.SIMLOADER.split_norm_att_name and mesh.SIMLOADER.split_norm_att_name ==k:
134+
if mesh.SIMLOADER.split_norm_att_name and mesh.SIMLOADER.split_norm_att_name == k:
136135
mesh.use_auto_smooth = True
137136
mesh.normals_split_custom_set_from_vertices(v)
138137

139138

140-
141139
def create_obj(fileseq, use_relaitve, transform_matrix=Matrix([[1, 0, 0, 0], [0, 0, -1, 0], [0, 1, 0, 0], [0, 0, 0, 1]])):
142140

143141
current_frame = bpy.context.scene.frame_current

simloader/utils.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,3 @@ def stop_animation():
2424
# if playing animation, then stop it, otherwise it will keep showing message box
2525
bpy.ops.screen.animation_cancel()
2626

27-
28-
def reserved_word_check(word):
29-
# if word in ['id', 'position', 'color']:
30-
return word + '2'
31-
# return word

0 commit comments

Comments
 (0)