Community
3ds Max Programming
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max SDK, Maxscript and Python topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MaxScript: fileProperties

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
istan
708 Views, 8 Replies

MaxScript: fileProperties

fileProperties.addProperty #custom "TEST" 1234

idx = fileproperties.findproperty #Custom "TEST"

Is it safe, that after creating such a file property, the index will never be changed again, no matter if other props are added later?

8 REPLIES 8
Message 2 of 9
Steve_Curley
in reply to: istan

No, because the user can add, edit or delete those properties (and any others) from the File > Properties dialog. If you create 3 properties "one", "two" and "three", then (through the dialog) delete "one" and re-create it they'll be in "two", "three", "one" order thereafter. Should be safe enough while a script is running, but not afterwards.

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

Message 3 of 9
istan
in reply to: istan

Ok. But how about when just new props are added, existing are changed but never deleted? Under MS I usually have IDs but no indices..
Message 4 of 9
Steve_Curley
in reply to: istan

According to the Help a "change" does just that - replaces the value without (re)moving the item, and a quick test confirms that (doesn't change the order). New props are just added to the end of the list so they don't alter the order either.
Probably safest to use the findProperty function unless you're sure the user can't have had the opportunity to manually change anything since the last time the script obtained the index.

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

Message 5 of 9
istan
in reply to: Steve_Curley

It is a time critical application and I don't want to waste time in the script, when not neccessary. I did not find any other solution on how to send a value back to a C++ plugin - (assuming AppData takes the same time). The best would be a script could return a value to C++, but this does not exist..

Message 6 of 9
Steve_Curley
in reply to: istan

Bearing in mind I've never used the SDK...
Can a plugin call maxscript? With parameters? If so pass a pointer to a [variable of the correct type] and in the MXS update the value appropriately. When you're back in the plugin you should be able to access that value.
Alternatively, is there a C++ interface to the fileProperties? If so deal with it in the plugin and ignore MXS entirely (for that at least).
Might be worth investigating what's available in the Python stuff as well.

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

Message 7 of 9
istan
in reply to: Steve_Curley

I know you are the  scripting guy 😉 Some time ago I got an email saying that SDK developers from AD will also check this board periodically soon... well, when is soon?

 

In SDK you can do almost everything - more than in MaxScript. I do not know, if I have access to the script parser from SDK, as I can only execute scripts but without any return code. Therefore there is no direct access from SDK to the MaxScript variables - at least I do not know of.

 

fileproperties, nodeproperties, appdata,..: all those exist in both environments, but they all have some overhead.

Message 8 of 9
Steve_Curley
in reply to: istan

You should be able to do pretty much anything with the SKD - with the one massive proviso that AD have made everything available (all the various interfaces/APIs for every feature of Max). If they haven't you're stuck. Doesn't the SDK documentation list everything you can get at? With something like Max there's always going to be overheads, but the SDK will almost certainly be the fastest way of getting at things.

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

Message 9 of 9
istan
in reply to: Steve_Curley

I again checked the doc and what shall I tell you: I totally forgot about the Maxscrpt.dll which I gave up using, as it always left memory. I will give it another try with the latest ver.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report