Save/Load render preset (.rps) inside maxfile. Possible?

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
Old 11 November 2013   #1
Save/Load render preset (.rps) inside maxfile. Possible?

Is it possible to save/load a binary file inside of max file?
For example. render preset file and uvw file.
 
Old 11 November 2013   #2
something like this ?

Code:
fn EncodeOnRootNodeDemo = ( if (fname = getOpenFileName caption:"load UVW" types:"UVW File(*.uvw)|*.uvw|" ) != undefined then ( if (fstream = fopen fname "rb") != undefined then ( fseek fstream 0 #seek_end maxlen = ftell fstream fseek fstream 0 #seek_set ss = StringStream "" for i = 1 to maxlen do print (ReadByte fstream #unsigned) to:ss fclose fstream; ) -- attach it to root node appdata setappdata rootnode 666 ss -- now the proof savemaxfile "this_is_appdata_test.max" resetMaxFile #noPrompt loadMaxFile "this_is_appdata_test.max" ss = StringStream (getappdata rootnode 666); if (fstream = fopen ((getFilenamePath fname) + "new.uvw") "wb") != undefined then ( while not eof ss do WriteByte fstream (readvalue ss) #unsigned fclose fstream; ) ) ) EncodeOnRootNodeDemo();

Last edited by Klunk : 11 November 2013 at 12:10 PM.
 
Old 11 November 2013   #3
Nice! Thanks!
 
Old 11 November 2013   #4
OK.. finally I had time to play with your code.
This is what I'm trying to do.

I want to run renderpresets.Save command and save *.rps data in the scene.
The problem is that I don't want to save temp rps file on the drive.
I want to put the data directly into appdata.
Then I want to load the appdata using renderpresets.Load

Thanks.
 
Old 11 November 2013   #5
think you are always going to have to use temp files somewhere along the line but they can be deleted once they have been used as the data will reside in the max file.

saving could be like...

save the rps as a temp file.
read back in and attach to the rootnode
delete the rps file.

restoring would then be...

write the rps from the rootnode data to temp rps file
load the temp rps file
delete temp rps file
 
Old 11 November 2013   #6
Thanks for reply.
I guess I need to find a better solution.

Thanks.
 
Old 11 November 2013   #7
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
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 10:48 AM.


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