Save RsObj

Smart people ~ Great Scripts
Post Reply
User avatar
trueBlue
Captain
Posts: 2105
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Save RsObj

Post by trueBlue » 08 Mar 2018, 14:40

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?
You do not have the required permissions to view the files attached to this post.

clintonman
Captain
Posts: 2851
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Save RsObj

Post by clintonman » 08 Mar 2018, 14:59

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.
Clinton Reese

http://clintons3d.com

User avatar
trueBlue
Captain
Posts: 2105
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Save RsObj

Post by trueBlue » 15 Aug 2018, 01:36

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.
You do not have the required permissions to view the files attached to this post.

Post Reply