Notifications
Clear all

[Closed] Force bitmaptexture update

this is one of those simple ones but It’s driving me a bit nuts – i can’t seem to force a reload() of a bitmaptexture on a material, without having the material in the material editor and displaying at the bitmap level.

I’m changing the diffusemap.filename property of a standardmaterial via script, and want it to update the viewport with the new material. The reload() method is suposed to trigger this, as the help says it’s the same as pressing the reload button on the material editor bitmap slot.

However, nothing happens when it is called, except if the bitmap is showing in the mat ed.
there is a similar function – viewimage() which exhibits a similar behaviour. Can this be done outside of this rather limited structure? or is there a hack to show the material editor on this bitmap level before i call it?

If i scrub the timeline, the map changes, so a nasty hack is to bump the timeslider forward and back. yuk.

somenode.material.diffusemap.filename = “blah.jpg”
somenode.material.diffusemap.reload()

and i also have “reload textures on change” checked in the preferences.

5 Replies

See if ‘freeSceneBitmaps()’ helps with updating…

no problems here, regardless… might your graphics driver be caching the texture for display?

I had a feeling nobody else was going to have this. freescenebitmaps() is not practical in this case, as it causes a large delay. If there was a way of triggering an update for just this map it would be better.

Rich, can you still call somenode.material.diffusemap.viewimage() without the mat ed up?

I will test it on another computer, as this was on my laptop that was exhibiting these ‘features’. :curious:

1 Reply
(@zeboxx2)
Joined: 1 year ago

Posts: 0

Nope – but that doesn’t seem to work for me regardless of whether I just set the bitmap via scripting, set it up entirely through standard 3ds Max UI work; .viewImage() seems to only work when medit is open -and- the map I’m calling it on is the currently active medit slot.

I can still display it via e.g. “display (objects[1].material.diffusemap.bitmap)”, of course – but then you don’t get the crop/place controls.

hi rich, thanks for your reply. I tried it on another computer, in max 2009 and it works fine, without needing a reload, just changing the filename is sufficient. what a pain in the ass.
its the reload/update that i really want. I tried swapping my display driver to opengl to check if that made a difference, but to no avail. i think it must be doing something like caching the texture on my laptop. ack!