PDA

View Full Version : UI loading....lag in max


JokerMartini
07-12-2011, 12:48 AM
I have a dialog that uses a round 2 dozen icons all 24x24px or smaller.
They are for the image buttons and they seem to really lag up max when I create the dialog.

I was wondering if anyone knew the most efficient way to go about creating this rollout.

Should I use dot net image buttons instead? Along with 64bit image processing?


Thanks
JokerMartini

denisT
07-12-2011, 01:01 AM
I have a dialog that uses a round 2 dozen icons all 24x24px or smaller.
They are for the image buttons and they seem to really lag up max when I create the dialog.


how long the lag is?

lo
07-12-2011, 05:36 AM
Along with 64bit image processing?

what does that mean?

JokerMartini
07-12-2011, 05:49 AM
I'll post the script tomorrow and then you can heck it out.
I'll post in the early morning.

denisT
07-12-2011, 09:56 AM
what does that mean?
for me the lag means a time interval between the moment of the calling and the fact of the actual showing of a tool's dialog.
i was asking how long it takes in your case... capiche?

lo
07-12-2011, 10:48 AM
Please read the thread more carefully Denis :curious:

JokerMartini
07-12-2011, 02:05 PM
Quick reply.....64bit

http://www.scriptspot.com/3ds-max/scripts/base64-dotnet-image-encoder

lo
07-12-2011, 02:42 PM
Quick reply.....64bit

http://www.scriptspot.com/3ds-max/scripts/base64-dotnet-image-encoder

That is not the purpose of Pete's tool. It is to convert images to text and vice versa... if anything, it will make your loading much slower.

Please post your code.

denisT
07-12-2011, 03:00 PM
That is not the purpose of Pete's tool. It is to convert images to text and vice versa... if anything, it will make your loading much slower.

Please post your code.

be patient or read the thread more carefully ("I'll post the script tomorrow and then you can heck it out. I'll post in the early morning.") ;)

lo
07-12-2011, 03:46 PM
be patient or read the thread more carefully ("I'll post the script tomorrow and then you can heck it out. I'll post in the early morning.") ;)

Yeah, but that was yesterday :cool:

JokerMartini
07-12-2011, 04:30 PM
It takes around 1.112 seconds and varies between that and 2.1 seconds.
I've attached the image and the script.

You will have to redirect the image path.

Let me know your thoughts please.
Thanks

lo
07-12-2011, 04:49 PM
instead of
local imgCurveTypes = @"C:\blablabla\curveTypes2.bmp"
use
local imgCurveType = openBitmap @"C:\blablabla\curveTypes2.bmp"
what's happening is that each button is opening the bitmap again and again because you are supplying it with a filename, not a bitmap value.

Though to be honest, even before that change it only took 120ms for me from a local path and 500ms from a network path.
You may have either a very slow network or a very slow machine.

JokerMartini
07-12-2011, 07:05 PM
Lo
Thank you very much.
I was unaware that it was loading that image for each button. I thought that max was quicker than that.
Thank you very much for your help.

John

LoneRobot
07-12-2011, 09:47 PM
The Base64 utility shouldn't strictly be used each time a script is run. I commonly use it in a startup struct that either -

1. checks for some script assets (e.g. when a script is first run) and creates the image assets for the script,
2.holds the images in a global struct that other scripts can call rather than loading similar icons each time a script is run.

It's just a dotnet equivalent to the setpixel method in the mxs help to allow distribution of code without dependencies.

looking at your code, I haven't run it but is the Q path a network path? that may not help your load performance if you are calling the same method via the network for 33 buttons. Just a thought though.

CGTalk Moderation
07-12-2011, 09:47 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.