Final trueSpace 7.61 Beta 8 Unofficial Update
- clintonman
- Captain
- Posts: 5434
- 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
Point Clone script - no history erase version, still can use up a lot of undos though.
The clean process is simpler. It uses the LE.CreateEncapsulationNode instead of multiple deletes and disconnections and save and load of objects to disc.
The scrubbers that updated other scrubbers were creating a bunch of undos because all the values were being updated. Changing 1 value was changing all 18 values.
Moved all the code out of the template so nothing is run from the inside of the node in the scene. It all runs from the script folder.
Changed the status messages to use the new undo friendly version.
Found a weird thing. If LE.CreateEncapsulationNode was run after a ConnectTo command the undos would stop at that point and not go back any further. So the combination was partially clearing history.
The clean process is simpler. It uses the LE.CreateEncapsulationNode instead of multiple deletes and disconnections and save and load of objects to disc.
The scrubbers that updated other scrubbers were creating a bunch of undos because all the values were being updated. Changing 1 value was changing all 18 values.
Moved all the code out of the template so nothing is run from the inside of the node in the scene. It all runs from the script folder.
Changed the status messages to use the new undo friendly version.
Found a weird thing. If LE.CreateEncapsulationNode was run after a ConnectTo command the undos would stop at that point and not go back any further. So the combination was partially clearing history.
- Attachments
-
- pointCloneScript28e.RsObj
- (181.29 KiB) Downloaded 124 times
Re: Final trueSpace 7.61 Beta 8 Unofficial Update
PointCloneTemplate panel
Press the Reset Default Values button
With nothing selected
Press the Start Clone button
Select a 3D Cube
ERR Source object: /Scripts/CustomCommands/pointCloneScript/pCloneItExternal Error: Microsoft JScript runtime error Description: Invalid procedure call or argument Error code: 0x800a0005 - (null) Line: 191, Char: 3 Script text: sourcemat = Node.Value(source,"WldMatrix");
Select a 3D Cube -> Note: BB Size 2.000, 2.000, 2.000
Press the Start Clone button
Select a different 3D Cube
PointCloneGroup, 1 -> Note: BB Size 4.000, 4.000, 4.000
In another test, I tried this with a Cube as Source and a Sphere as the Target
This process took along time and during the process I started selecting objects
After a couple of minutes the process completed
I think you need to implement a couple other processes
1) System.SetBusyCursor(true)
2) // To create the object faster, disable synchronization between
// Rosetta and trueSpace.
bEventsBlocked = tSBridge.RsTSEventsStatus();
tSBridge.BlockRsTSEvents(true);
3) Start Clone script
After the cloning process...
4) System.SetBusyCursor(false)
5) // Restore original bridge state and synchronize the tree object
tSBridge.BlockRsTSEvents(bEventsBlocked);
tSBridge.SynchronizeObject(objNode);
tSBridge.BlockRsTSEvents(false);
What are all of the Scripts for in the PointCloneGroup, 1?
And why are their Control In attribute exported out to the parent?
Press the Reset Default Values button
With nothing selected
Press the Start Clone button
Select a 3D Cube
ERR Source object: /Scripts/CustomCommands/pointCloneScript/pCloneItExternal Error: Microsoft JScript runtime error Description: Invalid procedure call or argument Error code: 0x800a0005 - (null) Line: 191, Char: 3 Script text: sourcemat = Node.Value(source,"WldMatrix");
Select a 3D Cube -> Note: BB Size 2.000, 2.000, 2.000
Press the Start Clone button
Select a different 3D Cube
PointCloneGroup, 1 -> Note: BB Size 4.000, 4.000, 4.000
In another test, I tried this with a Cube as Source and a Sphere as the Target
This process took along time and during the process I started selecting objects
After a couple of minutes the process completed
I think you need to implement a couple other processes
1) System.SetBusyCursor(true)
2) // To create the object faster, disable synchronization between
// Rosetta and trueSpace.
bEventsBlocked = tSBridge.RsTSEventsStatus();
tSBridge.BlockRsTSEvents(true);
3) Start Clone script
After the cloning process...
4) System.SetBusyCursor(false)
5) // Restore original bridge state and synchronize the tree object
tSBridge.BlockRsTSEvents(bEventsBlocked);
tSBridge.SynchronizeObject(objNode);
tSBridge.BlockRsTSEvents(false);
What are all of the Scripts for in the PointCloneGroup, 1?
And why are their Control In attribute exported out to the parent?
- clintonman
- Captain
- Posts: 5434
- 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
Thanks, will add check for proper selection.
1) why, what does it do?
2) good idea
4) again why, I've never seen this do anything
5) yep
I'll have to get back to you on the exported Control In, that sounds like some kind of mistake. I did change all the controls so they each don't update all the values, maybe something went wrong there. Or maybe it's related to the invalid selection bug you found.
I also need to make one more change. There are a couple of nodes used to calculate some values. They need to be replaced with plain math so the calculation doesn't eat up 2 more undos for each cloned object.
1) why, what does it do?
2) good idea
4) again why, I've never seen this do anything
5) yep
I'll have to get back to you on the exported Control In, that sounds like some kind of mistake. I did change all the controls so they each don't update all the values, maybe something went wrong there. Or maybe it's related to the invalid selection bug you found.
I also need to make one more change. There are a couple of nodes used to calculate some values. They need to be replaced with plain math so the calculation doesn't eat up 2 more undos for each cloned object.
Re: Final trueSpace 7.61 Beta 8 Unofficial Update
1) Look at the Mandelbrot script in the Objects - Script objects libraryclintonman wrote: ↑31 Mar 2021, 14:42 Thanks, will add check for proper selection.
1) why, what does it do?
2) good idea
4) again why, I've never seen this do anything
5) yep
I'll have to get back to you on the exported Control In, that sounds like some kind of mistake. I did change all the controls so they each don't update all the values, maybe something went wrong there. Or maybe it's related to the invalid selection bug you found.
I also need to make one more change. There are a couple of nodes used to calculate some values. They need to be replaced with plain math so the calculation doesn't eat up 2 more undos for each cloned object.
2) Look at the Magic Scuplturer script in the Objects - Script objects library
Re: Final trueSpace 7.61 Beta 8 Unofficial Update
2) Look at the Magic Scuplturer script in the Objects - Script objects library
This throws an error in tS761 Standalone
This throws an error in tS761 Standalone
- clintonman
- Captain
- Posts: 5434
- 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
OK thanks for the lesson. I didn't think it worked at all. It does work, but only for jscript objects, not for jscript commands.
Samples of each attached.
- Attachments
-
- TestBusyCursorObject.RsObj
- (33.48 KiB) Downloaded 119 times
-
- TestBusyCursorCommand.RsObj
- (4.89 KiB) Downloaded 120 times
- clintonman
- Captain
- Posts: 5434
- 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
OK will add test for bridge to avoid error.
Re: Final trueSpace 7.61 Beta 8 Unofficial Update
Thanks for the working example!clintonman wrote: ↑31 Mar 2021, 16:40OK thanks for the lesson. I didn't think it worked at all. It does work, but only for jscript objects, not for jscript commands.
Samples of each attached.
I had thought it's use would prevent selecting while it is busy.
After it is not busy it selects the last object selected while it was busy
So I guess you could use this in scripts as a means to show the script is working
Re: Final trueSpace 7.61 Beta 8 Unofficial Update
I was curious by your use of the CreateEncapsulationNode command
LE.CreateEncapsulationNode("","",0,0,true)
ScriptObject.RunCmd("linkeditor2 package/encapsulate command", "NodeName", "", "EncName", "", "x", 0, "y", 0, "Encapsulate3D", -1)
I created an Encapsulate object that resides in CustomCommands The 3D & 2D buttons call the incorporated scripts
These scripts are the same as the xml files except they use the above command and have status messages when complete
I was thinking about adding a RMB command to the toolbar Encap/Unencap icons that opens this panel in the Stack/Panels
Encapsulate
UserInterface.OpenToolPanelViewEx2("" , "" ,"Scripts/CustomCommands/Encapsulate", 3,0,0)
Unencapsulate
UserInterface.OpenToolPanelViewEx2("" , "" ,"Scripts/CustomCommands/Encapsulate", 4,0,0)
This will be in addition to how it is currently
Benefit
User is able to enter the Name before for the 3D/2D encapsulation without having the LE opened
Gives a status message
LE.CreateEncapsulationNode("","",0,0,true)
ScriptObject.RunCmd("linkeditor2 package/encapsulate command", "NodeName", "", "EncName", "", "x", 0, "y", 0, "Encapsulate3D", -1)
I created an Encapsulate object that resides in CustomCommands The 3D & 2D buttons call the incorporated scripts
These scripts are the same as the xml files except they use the above command and have status messages when complete
I was thinking about adding a RMB command to the toolbar Encap/Unencap icons that opens this panel in the Stack/Panels
Encapsulate
UserInterface.OpenToolPanelViewEx2("" , "" ,"Scripts/CustomCommands/Encapsulate", 3,0,0)
Unencapsulate
UserInterface.OpenToolPanelViewEx2("" , "" ,"Scripts/CustomCommands/Encapsulate", 4,0,0)
This will be in addition to how it is currently
Benefit
User is able to enter the Name before for the 3D/2D encapsulation without having the LE opened
Gives a status message
- clintonman
- Captain
- Posts: 5434
- 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
Also FYI
LE.CreateEncapsulationNode("","name 3d encaps here",0,0,true);
LE.CreateEncapsulationNode("","name 2d encaps here",0,0,false);
also assigns a name to the encapsulation node
I don't know if there is any difference between the long command and the short command, my guess is this short command never opens a dialog for naming, but that's just a guess.
LE.CreateEncapsulationNode("","name 3d encaps here",0,0,true);
LE.CreateEncapsulationNode("","name 2d encaps here",0,0,false);
also assigns a name to the encapsulation node
I don't know if there is any difference between the long command and the short command, my guess is this short command never opens a dialog for naming, but that's just a guess.