maxscript to cleanup STL imports ?

Become a member of the CGSociety

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

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  02 February 2013
maxscript to cleanup STL imports ?

Exists somewhere a maxscript to cleanup STL imports ?

e.g.:
Delete "unused" helpers
rename "-DC_Shell" objects

In my case i get many point helpers that are hierarchy linked: A object (DC Shell) is linked to a helper, is linked to a helper ... etc.

If i delete all helpers, than i get a clean scene, but all hierarchy is lost.
 
  02 February 2013
this can easily be fixed with maxscript.
Could you post a example file?
(with let's say 10 objects, helpers and so on) so that we can work with that?
This makes it much easier to help you with these things.
__________________
http://stigatle.no
 
  02 February 2013
I have a self made solution, seems to work fine:
to_delete = #()

fn iter_nodes node_children indent last_name =
(
	indent += 1
	for obj in node_children do
	(
		-- How to make this easier:
		spaces = ""
		for i = 1 to (indent*2) do spaces += "-"
		format "% %\n" spaces obj
		
		if (isKindOf obj Helper) do (
			if obj.name != "" and obj.name != "NONE" do (
				last_name = obj.name
			)
			
			if (obj.parent != undefined) and (obj.children.count == 1) then (
				append to_delete obj
			)
		)
		if (isKindOf obj Body_Object) do (
			format "% *** rename Body_Object from '%' to '%'\n" spaces obj.name last_name
			obj.name = last_name
		)
		
		iter_nodes obj.children indent last_name
	)
)
base_nodes = for o in objects where o.parent == undefined collect o
for obj in base_nodes do
(
	iter_nodes obj.children 0 undefined
)

for obj in to_delete do (
 	obj.children[1].parent = obj.parent
        delete obj
)
 
  02 February 2013
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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
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
CGSociety
Society of Digital Artists
www.cgsociety.org

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

All times are GMT. The time now is 06:44 PM.


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