Notifications
Clear all

[Closed] Creating objects internally

Hi

Is there a way to create an object with maxscript without adding it to the scene?

b = Box()

will create a box that’s already a node. whereas

a = bend()

will create a modifier that is not actually existent and will vanish as soon as i overwrite the variable with

a = 12

But is there a similar approach for other objects than modifiers? Can I create a cylinder and change it’s properties or even add a modifier without adding it to the scene?

In a next step I would like to make a snapshotasmesh from the internal geometry and discard it. But I really don’t need to have it in my scene at any point in time.

Perhaps .net will be helpful for this?

thanks in advance
David

5 Replies

b = createInstance box
b.mesh

Super awesome. Thanks a lot.

if you want to create it from scratch you can use…

msh = TriMesh();

creates a mesh with zero verts and zero faces

Okay, I’m probably asking for too much now. But can I also store an entire object with all transforms, modifiers etc. in memory?

something like

b = box()
m = bend()
addmodifier b m
createinstance b – This will obviously not work since it’s not a baseobject but a node

Can you think of any workaround or technique to store the entire object?

You could either merge ready object from external scene file or serialize and save all non-default value properties and then recreate the object on the fly
I’d use merge for anything complicated