do not load maps into viewport

Hey there,
I have a script that loads a bunch of materials from a materiallibrary and assigns them to different objects in the scene. It works well, but when there are huge maps inside the materials, I get some performance problems: Max will freeze after assigning the materials for several minutes. I am pretty sure that this happens, because it loads all maps to show them in the viewport. It does not happen with simple materials.
Is there any way to prevent that from happening? I tried to assign all materials in an  with redraw off( ) context and I also tried to change all materials to  material.showInViewport = false but both did not help.
Any ideas?

Cheers

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
br0t's picture

hehe fighting with callbacks,

hehe fighting with callbacks, that sounds funny :D Thanks for your effort Anubis! I tried it, but it does not seem to help reduce the "freezing" time. This is really weird, but maybe I'll just have to cope with it. The script is still quite a time saver, even if I have to wait a few minutes.
Regards

Never get low & slow & out of ideas

Anubis's picture

another idea

Ok, another idea - update scene materials (MtlBrowser feature).
It's works well here and maybe worth to try it.
--quick target scene setup:
for obj in selection do obj.mat = standard name:(obj.name + "_mat")
and when load your .mat file and update:

AttachmentSize
update_scene_mats.png 5.36 KB

my recent MAXScripts RSS (archive here)

Anubis's picture

strange issue

By default all new materials added to scene goes with showInViewport off, so this may come from some plugin. I have similar ugly problem (almost from 2 years) but with renderable shapes - my Max try (on every view port update) to turn on all of them and I fight with this with callbacks. Did you try something like...

fn turnMatOffInView = (
	(callbacks.notificationParam()).showInViewport = off
)
callbacks.removeScripts id:#matOff
callbacks.addScript #mtlRefAdded "turnMatOffInView()" id:#matOff

my recent MAXScripts RSS (archive here)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.