Notifications
Clear all
[Closed] Edit texture paths
Sep 09, 2010 7:27 pm
Hi everyone,
First, i should say, im a completely noob in maxscript. But i have to make a script to edit the texture paths.
Example of original path: C:/MyModel/Color.psd
And i have to change it like this: ./Whatever/Color.dds
Any help to board this?
I have this atm (Very very WIP)
rollout Hog_FBX_Exporter "Hog FBX Exporter" width:408 height:288
(
groupBox grp1 "Model Data" pos:[8,8] width:392 height:96
editText tbName "" pos:[104,40] width:208 height:16
label lbl1 "Model Name" pos:[16,40] width:64 height:16
label lbl2 "Color Map Path" pos:[16,72] width:80 height:16
editText tbColorMap "" pos:[104,72] width:208 height:16
button btGo "Export" pos:[112,232] width:200 height:32
groupBox grp2 "Options" pos:[8,120] width:392 height:96
button btGenTexturesFolder "Generic Textures Folder" pos:[64,160] width:132 height:32
button btModelFolder "Model Folder" pos:[216,160] width:132 height:32
pickButton btPickModel "Pick Model" pos:[320,40] width:72 height:48
on btPickModel picked obj do
(
ModelName=obj.name
tbName.text=ModelName
tbColorMap.text =obj.mat.diffuseMap.filename
)
--Path: generic textures folder
on btGenTexturesFolder pressed do
(
path="./GenericTextures"
tbColorMap.text=path
)
--Path: Same folder than model (Model and its folder must have the SAME name)
on btModelFolder pressed do
(
--path="../"+obj.name
path="./"+tbName.text
--messagebox path
)
on btGo pressed do
(
ModelName=tbName.text
path=tbColorMap.text
for m in getClassInstances BitmapTexture do
(
m.fileName=filenameFromPath m.fileName
print m.filename
)
)
)
createdialog Hog_FBX_Exporter
I can clean the paths, now i have to add text to the paths and change the extension from whatever to .dds
Thank you guys