Possible to automate the creation of 1000s of objects?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
Old 02 February 2013   #16
I would look at generating an Image-File-List IFL for texture variations then using a CSV file to animate values in max and thus you could send one job to Backburner and it would render all permutations. The next problem comes though from dealing with having one long sequence of images Render_0001.jpg etc... and how you can use these files after they're done.
Maxscript Made Easy...
Old 02 February 2013   #17
Hi Dave,

That's the less complicated part in my opinion as I can set-up an After Effects files to load in all these files as sequences and spit them back out exactly as I need them.

Thanks for the tip on using IFL by the way!!

Old 02 February 2013   #18
Backburner still has to load up 95% of itself, so it's only slightly less demanding in terms of loading and whatnot. What you could do, however...

There's a thing that ships with Backburner called cmdjob.exe. It allows you to submit windows command line scripts to backburner. This includes the ability to open max using the command line, and when opening max from the command line you have the option to have it automatically run a script. So what you could do is have your script which...

- Reads the .csv file
- Works out how many "tasks" it needs to perform (say, it needs to create and render 1,500 frames)
- Split this into smaller tasks - say, a group of 150 at a time, so you have ten separate jobs.
- Your script then writes out a bunch of maxscript code to 10 external files (which are actually text files, but you can name .ms [maxscript] files.
- You submit 10 jobs to backburner via cmdjob.exe, each job to open max and run one of the 10 scripts.

What is inside those 10 scripts are the meat of what you want it to do - the lofts and lathes or the sweeps etc. It could be set to create one, render it, delete all. Create the second, render it, delete all. Etc. The last line in this script is to quit max.

This way, your main script doesn't actually contain any of the code that creates the variations. What it contains is the ability to write those lines of code into other scripts. This has the benefit of not only working well with backburner, but you also a) don't need to send too many jobs b) leverage your render farm to render the tasks and c) leverage your render farm to actually process the creation of these bits of geometry. If you have more than 10 render nodes, you can split the task up into 100 separate files, or 1000. It's up to you.

(I use a similar system here to make changes to files before submitting them to render. Strictly speaking, there's no reason why this needs to be done via cmdjob.exe and a separate script, except that cmdjob.exe tasks in backburner support dependencies where as submitting raw max renders to backburner from maxscript does not... for some mad reason.)

Old 02 February 2013   #19
Originally Posted by DaveWortley: I would look at generating an Image-File-List IFL for texture variations then using a CSV file ...

right. that was the first what i thought about. but i asked myself after. why is it just a texture change? do we happy to have the same material for all our screens and frames? we have different profiles for frame but we have the same material for all of them. does it make sense?

so... we will change material on-fly as well of course it's kinda silly to have 1,500 materials just because they all have one different picture... so we will need system to re-use any shader by changing its textures(diffuse, specular, bump/normal).
yes. normal map. what if i want to have my portrait painted in oil? why do i have to have only a glossy photo?
Old 02 February 2013   #20
i'm absolutely sure that there are many cool and smart solutions with multiple files or multiple nodes in the same file. but this is not my point... finally i want to have only one file, with only one node, and CSV file that controls everything. CSV file could be made by a clerk of a hair-cut saloon or a funeral home. who doesn't know what 3ds max is. but the system must work anyway
Old 02 February 2013   #21
Denis, I think you hit the nail on the head, if someone with no knowledge of Max, programming or such, can generate the info needed to automate the process, then that's what I need to aim for. There would be some inital set-up needed such as manually creating the frames, but the rest should be automatic.

Thanks for all your input guys, I think that gives me enough info for now. Like I said I'm not looking to actually build the script at the moment, but just wanted to check the feasibility of doing something like this with programming, and if the project progresses in this direction I'd then look to have someone to build it.

Cheers guys,
Old 02 February 2013   #22
Originally Posted by denisT: what is the real problem? the real problem is the frame style. how to use different profiles for the frame shape and... AND have the frame shape animatable?

i promised to continue as i have a time...
Okay. Here is how to make frame profile animatable, which give as ability change profile on-fly

delete objects
	r = rectangle name:"frame" wirecolor:orange
	s = Sweep CustomShape:1 SmoothSection:off SmoothPath:off 
	p = converttosplineshape (arc name:"profile" radius:1 pie:off from:0 to:180 wirecolor:yellow)
--	for k=1 to numknots p do setKnotType p 1 k #corner
	setKnotType p 1 1 #corner
	setKnotType p 1 4 #corner
	s.shapes[1] = p
	addmodifier r s

	animatevertex p #all
	updateshape p
	c = p.baseobject[#master]
	animate on for k = 1 to 20 do at time (t = (k-1)*5) 
		r.width = random 10 50
		r.length = random 10 50
		radius = (random 0.02 0.1)*(amin r.width r.length)
		pos = c[2].value
		pos.x = radius
		c[2].value = pos
		pos = c[11].value
		pos.x  = -radius
		c[11].value = pos
		pos = c[5].value
		pos.x = (random 0.5 1)*radius
		pos.y = (random 0.5 1)*radius
		c[5].value = pos
		pos = c[8].value
		pos.x = (random -0.0 -1)*radius
		pos.y = (random 0.2 1)*radius
		c[8].value = pos
		--format "% = % > % % % %\n" t radius c[2].value.x c[5].value.x c[8].value.x c[11].value.x

we can have a list of presets and using one from the list set knot points and in/out tangents. that's easy...

Old 02 February 2013   #23
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 05:10 AM.

Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.