New\Keep Objects - no prompt

I'm looking for function which will do
actionMan.executeAction 0 "17" -- File: New Scene, Keep Objects
but without asking for save, I already tried:

actionMan.executeAction 0 "17" #noprompt

and

if checkForSave() do
(
actionMan.executeAction 0 "17" -- File: New Scene, Keep Objects
)

I also notice if I launch "New\keep objects" on medium level of complexity scene it almost always=max crssh. I work on max2013 however this problem don't exist on max2011. Is also any other access to this New\keep objects without involving
actionman?

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kredka's picture

popups

It also lose view perspective view:) and script give me popup with missing plugins in case of missing plugins on scene. Is there way to get rid of this annoying popups at least?

barigazy's picture

...

And why you lose it what do you think? :)
For missing plugins i don't know how to block this

bga

kredka's picture

close but not close enough

Thank you, smart nice script, I like it but Keep Objects - new/keep objects - remove hierarchy and all animations. Your script seems to only merge objects to new scene.

I menage to do this like:

select objects
deleteKeys objects #allKeys
(
for o in selection do for c in o.children do c.parent = undefined
)
saveMaxFile sceneName quiet:true
ResetMaxFile #noPrompt
mergeMAXFile sceneName #noRedraw #AutoRenameDups #useMergedMtlDups #alwaysReparent

but in this case objects with skin modyfier on it seems are broken additional settings are removed - Keep Objects don't behave in this way.

barigazy's picture

...

Why is so important to remove hierarchy? Leave it as it is and just removes keys

bga

barigazy's picture

...

Try this

fn newSceneKeepNodes =
(
	local tmpFile = ((getdir #autoback)+"\myScene.max")
	local viewTM = getViewTM()
	saveNodes objects tmpFile
	resetMaxFile #noPrompt
	mergemaxfile tmpFile
	viewport.setTM viewTM
	deleteFile tmpFile
)

bga

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.