Final trueSpace 7.61 Beta 8 Unofficial Update

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

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post by trueBlue »

clintonman wrote: 20 Aug 2022, 23:07
trueBlue wrote: 20 Aug 2022, 23:01 Hummm...
Only works for the first selected object could be mentioned

How would I write a Cycle Camera function?
In jScript:
var cycle = -1;
is before the function Execute(params)

There is going to be several Cycle scripts in one Function Set
Most use:
var cycle = 0
You'll have to change the names
"cycleXXX"
"cycleYYY"
Replace with names XXX/YYY with something that actually make sense.
Do you put:
var cyclecams = -1;
inside the Function or at the top?
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post by clintonman »

trueBlue wrote: 20 Aug 2022, 23:13
clintonman wrote: 20 Aug 2022, 23:07
trueBlue wrote: 20 Aug 2022, 23:01 Hummm...
Only works for the first selected object could be mentioned

How would I write a Cycle Camera function?
In jScript:
var cycle = -1;
is before the function Execute(params)

There is going to be several Cycle scripts in one Function Set
Most use:
var cycle = 0
You'll have to change the names
"cycleXXX"
"cycleYYY"
Replace with names XXX/YYY with something that actually make sense.
Do you put:
var cyclecams = -1;
inside the Function or at the top?
Something like this. Has to be outside the function or the value never changes

Code: Select all

var cycletwo = -1;
var cyclecams = -1;
function Cycle1(params) 
...
	cyclecams++;
	cyclecams = cyclecams % sceneCameras.length;
...
function Cycle2(params) 
...
	cycletwo++;
	cycletwo = cycletwo % sceneXXX.length;
Clinton Reese

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

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post by trueBlue »

Looks complicated, maybe I should forgo cycle functions and just add jScript Cycle scripts to UUCommands?
Edit: I got Cycle Cameras working for the CameraToolbar in a new UUCameraFuctionSet
The 3 other cycle scripts, if needed, will be added to UUCommands as jScripts
The UUCameraFuctionSet will have every CameraToolbar's LMB & RMB Commands
Note to Self: Many scripts, toolbar commands, Camera(S) button scripts, C3D toolbars and scripts plus C3D installers use these ScriptCommands/xml scripts
Edit2: Node.AccessFnSet does NOT work in Shortcuts!!!
Lots of digging... :bananasad:
User avatar
trueBlue
Captain
Posts: 5208
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post by trueBlue »

@Clinton
Setting a toolbar shortcut (Ctrl + RMB) that uses a Node.AccessFnSet does NOT work

Code: Select all

    <RS_WINDOW WINGUID="{F39966D8-6ADA-4EFA-83C2-F4343D3B02A7}">
        <RS_ACC KEY="DELETE" GROUP="WORKSPACEMAIN2" CONTEXT="" DESC="Delete - Delete selected objects / Preferences" COMMAND="UUFS = Node.AccessFnSet(&quot;Scripts/UUCommands/UUFunctionSet&quot;);UUFS.Delete()" />
        <RS_BLOCKASSOCIATIONS>
        </RS_BLOCKASSOCIATIONS>
    </RS_WINDOW>
Edit: I changed the toolbar command
var UUFS = Node.AccessFnSet('Scripts/UUCommands/UUFunctionSet');UUFS.Delete();
Not sure if adding the var or changing the double quotes in the path to single quotes is the key
Next test setting a shortcut (Ctrl + RMB)
Seems to be working now
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post by clintonman »

trueBlue wrote: 21 Aug 2022, 17:41 @Clinton
Setting a toolbar shortcut (Ctrl + RMB) that uses a Node.AccessFnSet does NOT work

Code: Select all

    <RS_WINDOW WINGUID="{F39966D8-6ADA-4EFA-83C2-F4343D3B02A7}">
        <RS_ACC KEY="DELETE" GROUP="WORKSPACEMAIN2" CONTEXT="" DESC="Delete - Delete selected objects / Preferences" COMMAND="UUFS = Node.AccessFnSet(&quot;Scripts/UUCommands/UUFunctionSet&quot;);UUFS.Delete()" />
        <RS_BLOCKASSOCIATIONS>
        </RS_BLOCKASSOCIATIONS>
    </RS_WINDOW>
Edit: I changed the toolbar command
var UUFS = Node.AccessFnSet('Scripts/UUCommands/UUFunctionSet');UUFS.Delete();
Not sure if adding the var or changing the double quotes in the path to single quotes is the key
Next test setting a shortcut (Ctrl + RMB)
Seems to be working now
I think single quotes is what fixed it. According to internet "&quot;" means double quotes so maybe that was messing it up. Did you get error message or just nothing?
Clinton Reese

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

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post by trueBlue »

When I first (Ctrl + RMB) set the toolbar Delete shortcut, it did not work and no error
But more importantly, the Shortcut file got hosed big time, wiped out a whole bunch of the shortcuts
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post by clintonman »

trueBlue wrote: 21 Aug 2022, 19:48 When I first (Ctrl + RMB) set the toolbar Delete shortcut, it did not work and no error
But more importantly, the Shortcut file got hosed big time, wiped out a whole bunch of the shortcuts
"wiped out" - Did it erase the shortcuts or just break them?
Clinton Reese

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

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post by trueBlue »

clintonman wrote: 21 Aug 2022, 19:55
trueBlue wrote: 21 Aug 2022, 19:48 When I first (Ctrl + RMB) set the toolbar Delete shortcut, it did not work and no error
But more importantly, the Shortcut file got hosed big time, wiped out a whole bunch of the shortcuts
"wiped out" - Did it erase the shortcuts or just break them?
Erased!
Morale of the Story, No double quotes in toolbar commands!
I also think it is important in scripts too!
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post by clintonman »

trueBlue wrote: 21 Aug 2022, 20:15
clintonman wrote: 21 Aug 2022, 19:55
trueBlue wrote: 21 Aug 2022, 19:48 When I first (Ctrl + RMB) set the toolbar Delete shortcut, it did not work and no error
But more importantly, the Shortcut file got hosed big time, wiped out a whole bunch of the shortcuts
"wiped out" - Did it erase the shortcuts or just break them?
Erased!
Morale of the Story, No double quotes in toolbar commands!
I also think it is important in scripts too!
Wow. In any case keep an eye out, because it may also be something else. I say that cause I tried to reproduce the non-working shortcut with double quotes and it worked. It was too hard to tell if any shortcuts where erased from the file.
Clinton Reese

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

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post by trueBlue »

Which toolbar and button Command did you try?
Edit: I tried setting the WorkspaceMain2/Perspective button's shortcut:

Code: Select all

UUFS = Node.AccessFnSet("Scripts/UUCommands/UUFunctionSet");UUFS.Perspective()
It worked even though the command has double quotes and do not see any issues with existing shortcuts
Guessing my prior experience was a fluke
Or maybe it was because it was the Delete button that had an existing (different) shortcut already assigned
Post Reply