Notifications
Clear all

[Closed] Reading userporp

 MZ1

How we can read object userproperties without loading max file?

8 Replies

Off the top of my head, you could merge in just the object you want, read the properties, then delete it again. However if you want to read all the objects in a scene, then a merge-read-delete would still be the best way i know to make that happen without having to close the scene you’re in.

 MZ1

Merge_Read_Delete is good way in many cases,also we can use it in redraw off, but here we have large textures that comes from network path and I want to prevent loading any textures.

3 Replies
(@norman3d)
Joined: 11 months ago

Posts: 0

I think it’s not possible to prevent the loading of textures. Have a look at this thread.

I was not able to run any function before the “missing textures” window popped up.

(@denist)
Joined: 11 months ago

Posts: 0

these are two different things: “open bitmaps” and “show missed textures warning”.
all information about scene assets (including texture files) stored in some file data and read with file opening. The warning message about missed textures shows before(!) bitmaps opening.

a scene loads bitmaps when it create any instance of this bitmap (texturemap for example). So if we will not load materials any way, the bitmaps used by materials will not be loaded.

there is no way to NOT read materials (open bitmaps) using merge file and load file system. But using objXRefMgr.AddXRefItemsFromFile you can do. After you xreffed the scene you can read properties of any object of this scene.

 MZ1
(@mz1)
Joined: 11 months ago

Posts: 0

Seems Load_Merge_Delete with Xref is a good way. Thank You

 MZ1

You can use this code to prevent popup error windows:

loadMaxFile quiet:true
1 Reply
(@norman3d)
Joined: 11 months ago

Posts: 0

Yes, don’t mean to go offtopic, but what I wanted to do with the script is to have a callback script launch right after the user opens a max file. In order to get the textures from perforce before the missing files window popped up. I don’t really think “loadMaxFile quiet:true” would be helpful, since the user would be opening the max file manually, not through a script.

right! Thanks for clearing that up! I thought MZ was referring to the max file “acessing” the network drive for the first time in order to check if the bitmaps were existing.