Mass script installer

free scripts, plugins, models, textures
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Mass script installer

Post by clintonman »

autoreinstaller.jpg
Something I created for myself so that I could quickly reinstall scripts after a reset to default context. Image shows the Custom toolbar, NURBS toolbar and the AutoReinstaller layout tab at the top. The new AutoReinstaller layout tab is not a layout, but a script for reinstalling scripts. The layout library survives the reset process so the script is always available. It includes a library that contains several automatic installer scripts and a script that loads them into truespace. The library also includes the rsx plugin files required by some of the scripts. The rsx files do not install automatically.

Mass Installer/Reinstaller near the top of the page:

http://www.clintons3d.com/plugins/trues ... index.html"
Clinton Reese

http://clintons3d.com
froo
Captain
Posts: 2554
Joined: 22 May 2009, 12:13

Re: Mass script installer

Post by froo »

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

Re: Mass script installer

Post by trueBlue »

Awesome Clinton!
clintonman wrote:The rsx files do not install automatically.
You can Install & Load plugins from script too if you wish.
Example:
RsPackage.Install("C:\\trueSpace761\\Vray_ts.rsx")
RsPackage.Load('Vray Package')
It is also possible to load scripts automatically when tS is reset. If interested I can share what I have learned from the reset.js
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Mass script installer

Post by clintonman »

trueBlue wrote:Awesome Clinton!
clintonman wrote:The rsx files do not install automatically.
You can Install & Load plugins from script too if you wish.
Example:
RsPackage.Install("C:\\trueSpace761\\Vray_ts.rsx")
RsPackage.Load('Vray Package')
It is also possible to load scripts automatically when tS is reset. If interested I can share what I have learned from the reset.js
I saw that script load for rsx, but decided to put it off for a bit. I only have 3 rsx packages and they don't disappear after resetting to the default context. I also thought I saw somewhere about changing some xml file to load plugins and if so would it be better than the rsx script load option?
I saw that reset.js while researching, but I don't understand when it runs. Does it run when you use the ctrl key while starting or maybe it runs when you reset the default context or every time truespace runs?
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Mass script installer

Post by trueBlue »

The reason I suggested Install/Load your plugins would be for a more complete install purpose, in with which a user had not installed before. I noticed it does not hurt running if it is already installed. The way I understand the RsPackage.Install() command, it creates and or writes to the Plugins.xml file located in the Scripts folder. When you open tS761 the init.js file runs. In this script you will notice the RsPackage.Import('plugins.xml'); command. I beleive the reset.js runs when a user Resets the Default Context. In that script you will notice two commands:
ScriptObject.ImportScripts(0);
ScriptObject.UpdatePck(0);
As I understand it, this command reads the Scripts/ScriptCommands folder and loads all of the scripts within, into tS761 in the System/Scripts/Commands node. The scripts have to be named from within the Script Editor's Attribute area in order for this to work right. This is how I loaded all of the scripts included in the last Unofficial Update. You will notice an OnNewScene script which gets called
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Mass script installer

Post by clintonman »

trueBlue wrote:The reason I suggested Install/Load your plugins would be for a more complete install purpose, in with which a user had not installed before. I noticed it does not hurt running if it is already installed. The way I understand the RsPackage.Install() command, it creates and or writes to the Plugins.xml file located in the Scripts folder. When you open tS761 the init.js file runs. In this script you will notice the RsPackage.Import('plugins.xml'); command. I beleive the reset.js runs when a user Resets the Default Context. In that script you will notice two commands:
ScriptObject.ImportScripts(0);
ScriptObject.UpdatePck(0);
As I understand it, this command reads the Scripts/ScriptCommands folder and loads all of the scripts within, into tS761 in the System/Scripts/Commands node. The scripts have to be named from within the Script Editor's Attribute area in order for this to work right. This is how I loaded all of the scripts included in the last Unofficial Update. You will notice an OnNewScene script which gets called
That's a lot of good info. You lost me on a couple of sentences:
"The scripts have to be named from within the Script Editor's Attribute area in order for this to work right."
Edit: Never mind on this one. I didn't even know that was an editable field.

"You will notice an OnNewScene script which gets called"
Maybe the end of the sentence is missing?
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Mass script installer

Post by trueBlue »

LOL... I answered a phone call in the middle of that sentence.
You will notice an OnNewScene script which gets called when you run Generate New Scene.
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Mass script installer

Post by clintonman »

Thanks, I'm going to add these notes to the wiki, so I can find them when I need them.
Clinton Reese

http://clintons3d.com
User avatar
Draise
Captain
Posts: 3200
Joined: 21 Sep 2009, 19:33
Type the number ten into the box: 0
Location: Bogota, Colombia

Re: Mass script installer

Post by Draise »

Awesome Awesome Awesome!!!
Here I was installing a new TS to another computer and then hand installing scripts and buttons one by one by one!!! You are legend, thanks for the time save.
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Mass script installer

Post by trueBlue »

FYI: Unless you save your Widgets, they will be lost once you Reset the Default Context.
This script deletes the presently loaded widgets, otherwise they will be duplicated. Then saves and reloads them.

Code: Select all

Node.Delete("/Widgets/Active Widgets Layer2/Active Widget")
Node.Delete("/Widgets/Active Widgets Layer2/Active Widget, 1")
Node.Delete("/Widgets/Active Widgets Layer2/Active Widget, 2")
Node.Delete("/Widgets/Active Widgets Layer2/Active Widget, 3")
Node.Delete("/Widgets/Active Widgets Layer2/Active Widget, 4")
Node.Delete("/Widgets/Active Widgets Layer2/Active Widget, 5")
Node.Delete("/Widgets/Active Widgets Layer2/Active Widget, 6")
Node.Delete("/Widgets/Active Widgets Layer2/Active Widget, 7")
Node.Delete("/Widgets/Active Widgets Layer2/Active Widget, 8")
Node.Delete("/Widgets/Active Widgets Layer2/Active Widget, 9")
RsFileIO.SaveObject(System.GetMainDir() + '\\Scripts\\preobjects\\Widgets.RsObj', '/Widgets')
Widgets.ActivateWidget('/Widgets/Tools/ViewWidget','Default', '', '')
Widgets.ActivateWidget('/Widgets/Tools/Background','Default', '', '')
Widgets.ReplaceWidget('{5C9008D4-B6B3-4359-9E63-18D2FC228A6E}','/Widgets/Edit/Default context','Default','','/Widgets')
Widgets.SetWidgetGroupDependency('{5C9008D4-B6B3-4359-9E63-18D2FC228A6E}','{E8913C00-9A2A-43cf-8238-27B4BFB50A1F}')
Widgets.SetWidgetGroupDependency('{5C9008D4-B6B3-4359-9E63-18D2FC228A6E}','{88839603-7F98-41f0-96AC-BE94E801CFF3}')
Widgets.SetWidgetGroupDependency('{E8913C00-9A2A-43cf-8238-27B4BFB50A1F}','{88839603-7F98-41f0-96AC-BE94E801CFF3}')

Return to “Repositorium”