Page 1 of 1

Save RsObj

Posted: 08 Mar 2018, 14:40
by trueBlue
Always wanted a Save as RsObj
It has been right under our noses in the Objects - Tutorial Objects library.
Here is a WIP I am working on.
Warning! If you do not have the new update installed, the example file location is set to save a selected object to:
C:\trueSpace761\tS\Rs Main Libraries\My Objects\My Object.RsObj
So change the File location if you do not have the new update and or using another version of tS other than trueSpace761
Things to do:
Get selected object's name and enter it into the FileName's path.
Get and Set object's thumbnail. As it is now it saves the active window's thumbnail
Get and Set all User's properties.
Save as a ScriptCommand xml file.
Incorporate it into the trueSpace761 File Menu.

@ clintonman: Wonder if you can use the information in this script to incorporate into your Save as Dialog?

Re: Save RsObj

Posted: 08 Mar 2018, 14:59
by clintonman
The save as dialog is for getting file names from the user, so it would be the opposite. The save as dialog would be incorporated into something else.

Code: Select all

filedata = System.CreateDO('Clintons3d Package/File Save As data');
filedata.SetName("My special (*.bob)~*.BOB~Collada Files (*.dae)~*.DAE~All Files (*.*)~*.*~~");
file = filedata.GetName();
System.Alert(file); 
uses "~" as a delimiter between the description and the extension and end the string with 2 ~'s
The "SetName" function is poorly named. It should be "SetType" or "SetFileType"
GetName calls the dialog and returns the file name.

Re: Save RsObj

Posted: 15 Aug 2018, 01:36
by trueBlue
Finally finalized this project.
It will be included in the up coming Unofficial Update 4.

Opens from the Workspace file menu.
Used in conjunction with Clinton's Clintons3D Package/Utility functions plugin, to get selected object's name and Folder dialog.