Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
blender-addons
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blender
blender-addons
Commits
fc59c46c
Commit
fc59c46c
authored
6 years ago
by
Kalle-Samuli Riihikoski
Browse files
Options
Downloads
Patches
Plain Diff
fixed a texture naming bug
parent
fc75dc64
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
io_coat3D/__init__.py
+12
-4
12 additions, 4 deletions
io_coat3D/__init__.py
io_coat3D/tex.py
+2
-8
2 additions, 8 deletions
io_coat3D/tex.py
with
14 additions
and
12 deletions
io_coat3D/__init__.py
+
12
−
4
View file @
fc59c46c
...
...
@@ -143,10 +143,7 @@ def set_working_folders():
platform
=
os
.
sys
.
platform
coat3D
=
bpy
.
context
.
scene
.
coat3D
if
(
platform
==
'
win32
'
):
if
(
bpy
.
data
.
filepath
==
''
):
folder_objects
=
os
.
path
.
expanduser
(
"
~
"
)
+
os
.
sep
+
'
Documents
'
+
os
.
sep
+
'
3DC2Blender
'
+
os
.
sep
+
'
ApplinkObjects
'
else
:
folder_objects
=
os
.
path
.
dirname
(
bpy
.
data
.
filepath
)
+
os
.
sep
+
'
3DCApplink
'
folder_objects
=
os
.
path
.
expanduser
(
"
~
"
)
+
os
.
sep
+
'
Documents
'
+
os
.
sep
+
'
3DC2Blender
'
+
os
.
sep
+
'
ApplinkObjects
'
if
(
not
(
os
.
path
.
isdir
(
folder_objects
))):
os
.
makedirs
(
folder_objects
)
else
:
...
...
@@ -316,6 +313,7 @@ class SCENE_OT_export(bpy.types.Operator):
material
.
material
.
node_tree
.
nodes
.
remove
(
node
)
return
{
'
FINISHED
'
}
class
SCENE_OT_import
(
bpy
.
types
.
Operator
):
...
...
@@ -339,6 +337,10 @@ class SCENE_OT_import(bpy.types.Operator):
coat3D
.
exchangedir
=
set_exchange_folder
()
texturelist
=
make_texture_list
(
coat3D
.
exchangedir
)
for
texturepath
in
texturelist
:
for
image
in
bpy
.
data
.
images
:
if
(
image
.
filepath
==
texturepath
[
3
]):
bpy
.
data
.
images
.
remove
(
image
)
Blender_folder
=
(
"
%s%sBlender
"
%
(
coat3D
.
exchangedir
,
os
.
sep
))
...
...
@@ -376,6 +378,8 @@ class SCENE_OT_import(bpy.types.Operator):
old_materials
=
bpy
.
data
.
materials
.
keys
()
old_objects
=
bpy
.
data
.
objects
.
keys
()
old_images
=
bpy
.
data
.
images
.
keys
()
image_list
=
[]
object_list
=
[]
import_list
=
[]
mesh_del_list
=
[]
...
...
@@ -397,11 +401,15 @@ class SCENE_OT_import(bpy.types.Operator):
new_materials
=
bpy
.
data
.
materials
.
keys
()
new_objects
=
bpy
.
data
.
objects
.
keys
()
new_images
=
bpy
.
data
.
images
.
keys
()
diff_mat
=
[
i
for
i
in
new_materials
if
i
not
in
old_materials
]
diff_objects
=
[
i
for
i
in
new_objects
if
i
not
in
old_objects
]
diff_images
=
[
i
for
i
in
new_images
if
i
not
in
old_images
]
for
c_index
in
diff_mat
:
bpy
.
data
.
materials
.
remove
(
bpy
.
data
.
materials
[
c_index
])
for
i
in
diff_images
:
bpy
.
data
.
images
.
remove
(
bpy
.
data
.
images
[
i
])
#The main Applink Object Loop
...
...
This diff is collapsed.
Click to expand it.
io_coat3D/tex.py
+
2
−
8
View file @
fc59c46c
...
...
@@ -41,13 +41,8 @@ def readtexturefolder(objekti,is_new): #read textures from texture file
texcoat
[
'
nmap
'
]
=
[]
texcoat
[
'
disp
'
]
=
[]
if
(
is_new
==
True
):
files_dir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
objekti
.
coat3D
.
applink_address
))
else
:
if
(
bpy
.
data
.
filepath
==
''
):
files_dir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
objekti
.
coat3D
.
applink_address
))
else
:
files_dir
=
os
.
path
.
dirname
(
bpy
.
data
.
filepath
)
+
os
.
sep
+
'
3DCApplink
'
files_dir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
objekti
.
coat3D
.
applink_address
))
files
=
os
.
listdir
(
files_dir
)
materiaali_muutos
=
objekti
.
active_material
.
name
uusin_mat
=
materiaali_muutos
.
replace
(
'
Material.
'
,
'
Material_
'
)
...
...
@@ -58,7 +53,6 @@ def readtexturefolder(objekti,is_new): #read textures from texture file
tex_name
=
listed
[
-
2
]
texcoat
[
tex_name
].
append
(
koko_osoite
)
createnodes
(
objekti
,
texcoat
)
def
checkmaterial
(
mat_list
,
objekti
):
#check how many materials object has
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment