Notifications
Clear all
[Closed] Copy JPG files copyFile
Jul 01, 2010 9:46 am
Im currently working on a script that exports models into 3ds format and I would like the textures from that model (models directory) to be copied to the same export location as the 3ds file.
explanation of the script:
I have 1 model and I want to export it in 3 colors (thus 3 textures (3 buttons)), could be more in the future. For every button I have the same script. HOWEVER, only the FIRST script works.
Ive tried different locations. Reopening the script window to refresh/restart the script, but alas, only the first texture is being copied to the wanted location.
Ive attached a sample script, in the actual script the export location is attached to a browsable location.
rollout buttontest "1 Button Test" width:150 height:100
(
button but1 "Button 1" pos:[25,10] width:100 height:21
button but2 "Button 2" pos:[25,40] width:100 height:21
button but3 "Button 3" pos:[25,70] width:100 height:21
on but1 pressed do
(
for d in GetDirectories "C:\YAMAHA\mat\maps\l8y1\*" do
for f in getFiles (d + "*.*") do
(
copyFile f ("C:\YAMAHA\mat\\" + getFilenameFile f + getFilenameType f)
)
)
on but2 pressed do
(
for d in GetDirectories "C:\YAMAHA\mat\maps\l8u1\*" do
for f in getFiles (d + "*.*") do
(
copyFile f ("C:\YAMAHA\mat2\\" + getFilenameFile f + getFilenameType f)
)
)
on but3 pressed do
(
for d in GetDirectories "C:\YAMAHA\mat\maps\l8s1\*" do
for f in getFiles (d + "*.*") do
(
copyFile f ("C:\YAMAHA\mat\\" + getFilenameFile f + getFilenameType f)
)
)
)
createDialog buttontest
t.i.a.