Notifications
Clear all

[Closed] Simple way to save arbitrary data in a scene?

Hi Folks,

I’ve got a few pipeline / workflow things to look at and it’d be handy to be able to save data in a max scene without needing to attach it to objects. Two cases in particular:

A “Key all” button similar to maya – fine to do since I can hang it off selection sets but is there another place I can save things like arbitrary collections of objects or specific controller tracks? Ideally this’d be some kind of self updating floating utility so you could select and key things from the same little window.

File versioning – for simple shot revisions to specific shot codes it’d be great to have a base filename with numbering / version up functionality in the scene. Simple string values would be fine but having a save button that’ll update all your render passes to match the scene revision would be great, especially if it’s based off an external text file.

What is the simplest or most robust method for saving data in your max scenes? Is there an overall “Scene data” container for this type of thing that isn’t associated with scene objects, or do people make hidden helper objects and assign custom attributes as containers?

Probably a very old topic at this stage but I generally only learn bits on a need to know basis. Much appreciate for any thoughts!

4 Replies

Custom Attributes on the rootScene probably. You can find more info on that in the help here.

-Eric

EDIT: more info here.

Eric you’re a superstar, thanks for the reply and I’ll start delving in.

Hi John,

Here’s a quick example of how to add two variables myFloat and myString to the scene root.

(
	myData_CA_Def = attributes myDataCA version:1 attribID:#(0x51bd3371, 0x1d487e47)
	(
		parameters main
		(
			myFloat type:#float  default:100.0
			myString type:#string default:"Hello"
		)
	)
	CustAttributes.add rootnode myData_CA_Def
)

And to retrieve them…

(
	format "myFloat = %
" rootNode.myFloat
	format "myString = %
" rootNode.myString
)

You’ve probably worked it out for yourself by now but unless they’ve rewritten the help recently there aren’t any basic examples in there. Hope it’s some use anyway.

Dan that’s very useful – it’s paring it back to the very basics which is handy for me. The MXS docs are doing things in a more oop fashion as opposed to my usual style of jackass plain text type coding. Much appreciated, once I get this and the various array types sorted out, I should be able to come up with most of what I want to do.

Cheers for the pointer!