ScriptSpot

Forum topic · General Scripting

File in use!

By artrender.info · 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)

but are you sure

artrender.info · 2013-05-21

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

barigazy · 2013-05-21

Probably have different preview options then .net label.

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

artrender.info · 2013-05-20

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

ok!

artrender.info · 2013-05-20

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

barigazy · 2013-05-20

No. Thake look these thread by fajar. http://forums.cgsociety.org/showthread.php?f=98&t=1107357. Then see link in the first post. You want something like that :). Me to. But I not know C# or C++ or VB. You need to find good programer to compile that tool for you.

don't give up!

artrender.info · 2013-05-20

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

barigazy · 2013-05-20

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

however

artrender.info · 2013-05-20

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!

I think

artrender.info · 2013-05-20

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!

barigazy · 2013-05-20

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

haha!

artrender.info · 2013-05-20

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

:)

barigazy · 2013-05-20

You could say.
Cheers!

hahaha!

artrender.info · 2013-05-20

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?

:)

barigazy · 2013-05-20

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

I've answered! Thx!

artrender.info · 2013-05-20

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?

:)

barigazy · 2013-05-20

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

how do you answer so quick?

artrender.info · 2013-05-20

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

:)

barigazy · 2013-05-20

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

hm!

artrender.info · 2013-05-20

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?

Thx Barigazy!

artrender.info · 2013-05-20

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

:)

barigazy · 2013-05-20

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

barigazy · 2013-05-20

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