Notifications
Clear all

[Closed] Problem with cloning Teapot(editable poly, 32000+ polys) 1000 times

Is it possible to create 1000(or more) copies of one editable poly object(30 000+ polys) using script?

My code is:


(
	max create mode
	
	t = convertToPoly (teapot segments:32)
	newNodeArr = #()
	disableRefMsgs()
	for i = 1 to 1000 do with redraw off
	(
-- 		copy t
		maxOps.CloneNodes t cloneType:#copy newNodes:&newNodeArr		
	)	
	enableRefMsgs()
)

I have 8GB of RAM but 3dsMax eats all of it. At the end Max crashes.

I’ve tried to create 1000 copies of the teapot(converted to editable_poly) using shift+drag and type 1000, but the situation is the same as when i use the script above.

When I use teapot primitive, instead of converted to editable poly teapot, 3dsMax craetes 1000 copies(each with 32 segments = 32000+ polys) very fast.

Am I doing something wrong, or this is 3dsMax’s limitation/bug?

6 Replies

Your script works for me. But of course it takes a lot of RAM.

convertToPoly: ~13GB RAM
convertToMesh: ~8GB RAM

Thank you.
Now I knowe where the problem is.

#1 why does the editable poly take so much memory?
because the EP stores a lot of data for fast access and calculation. loops, rings, soft selection, normals, edges, face areas… all this stuff is stored. structures are designed more to work fast than be compact.

#2 why the cloning is slow?
it’s almost the same issue. all this data has to be updated.

well…

#3 what can we do with it?
unfortunately it’s not too much. i don’t have max to check but try:

  1. do clone with undo off
  2. clone as references or instances. (and make them unique after that)
  3. use instance(reference) method instead of maxops.clonenodes

also you have to understand that you are trying to make 32M verts scene. it’s a big number for the max. i never tried to make this size scenes, and i’m not sure the max can handle it at all.

1 Reply
(@swordslayer)
Joined: 10 months ago

Posts: 0

The only limiting factor here is the viewport performance, having wokred regularly with 100M/200M poly scenes (automotive CAD data, editable meshes only) I’d say you wouldn’t want to try that with an integrated graphics card. These scenes take up around 8-12 GB of RAM when opened (2-4 GB filesize), twice that amount when rendering (that would of course vary with different renderers, settings etc.). Other than that there’s no notable performance difference although you might want to clear undo buffer after deleting all scene nodes, for example.

on top of all that it still has to build the display meshes that get passed to gpu.