ScriptSpot home

Forum topic · General Scripting

File in use!

By artrender · 2013-05-20

Description

people! I've got a problem! I use

dotNetControl dropbtn "System.Windows.Forms.Label" pos:[70,4] width:155 height:121
dropbtn.BackgroundImage = (dotNetclass "System.Drawing.image").fromfile (....001.jpg)

and everything is working ok, but when I change the file 001.jpg and try to save it, it sais : cannot save, file in use :(((

how to solve that? It is very important to know!

Comments (22)
artrender

but are you sure

that this image viewer - imagelistview won't use the file like usual dotnet label?

Reply to artrender
Branko Živković

Probably have different preview options then .net label.

artrender

10 years ago I was working in C++ but I forgot everything!

hm, let's see! Thx Barigazy! Good Night!

artrender

ok!

But is it possible to make preview of a file in maxscript without net, with the support of rescaling this picture, update it ...?

artrender

don't give up!

what happens when you press on "view image" btn?

Reply to artrender
Branko Živković

You will be open "Open" dialog window. Are you want .net solution for that?

artrender

however

I still think there is a way of solving it without making thumbs! Think, Barigazy! You know a lot! Just get in your labyrinth and you'll get the solution, I'm sure of that! You can do anything in maxscript!

artrender

I think

it should also be sensitive of source file changing! If I make thumbs, and I list some textures, they should update only those that changed, otherwise, it will be very slow!

Reply to artrender
Branko Živković

In any case will be slow for sure. That's why people create plugins for that reason. Mxs is not for that.

artrender

haha!

The wisdom can help to see the future! I see that you have a source of inspiration! Anyway, thank you!

artrender

hahaha!

Yes, srry! I want to display textures as preview in my script! Now when I see that I cannot edit it in photoshop and then resave it, I'm sad about it! I could even change the dropbtn.BackgroundImage = .. another file after opening in photoshop, but it still gets a while till it understands that it is unused! How to free it from usage momentarily, as it is opened in photoshop? If this is not possible, wouldn't it be slow to make copies for every texture in order to make priview of them? May be I have to make automatically from the script small thumbs for all the textures in a tmp folder and use them? How do you think?

Reply to artrender
Branko Živković

:)

I think that the smart choise is to create thumbs. Let say that you have image (panorama) 20000x2000px. This size in not good for the thumbs, obviously.
And how to create automaticaly thumbs with mxs? This is probably your next question :). Honestly I do not know

artrender

I've answered! Thx!

But the question still remains! why when I open a texture in 3d max - view image inside bitmapslot, it's showing, and it is still possible to save from photoshop changes?

Reply to artrender
Branko Živković

:)

I not know that. Maybe some programer can have answer :). Are you always try to achive something unachievable?

artrender

how do you answer so quick?

do you press on f5 every 3 minutes? Or you have a script for that?

Reply to artrender
Branko Živković

:)

Funny question. You not answered about context menu and "REC" button. Is it works?

artrender

hm!

But why when I open a texture in 3d max - view image inside bitmapslot, it's showing, and it is still possible to save from photoshop changes?

artrender

Thx Barigazy!

But I want to have the image opened in 3dsmax through my script at that time !!

Reply to artrender
Branko Živković

:)

Windows not allow that. Why not use image as temp of original (copy) file and live original unused

Branko Živković

Save it as different name or destroy dialog and then try to save. Also if you use global variable for rollout then you need to make sure to set it as undefined