Final trueSpace 7.61 Beta 8 Unofficial Update
- clintonman
- Captain
- Posts: 5430
- 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
tS bridge tools recommended by tB
changed the way the tool works because the Selection Change Event was causing the number of undos to double in number.
I think I added a status update during the cloning process, maybe it was already there, not sure.
Use pure math for point normal calculations which removes 2 extra undos for each object.
New tool usage - select the items to clone then add the target to the selection and press Start
"And why are their Control In attribute exported out to the parent?"
I don't see that at all
The process still generates a large number of undos. Which is an improvement since before it was a crazy number of undos.
tS bridge tools recommended by tB
changed the way the tool works because the Selection Change Event was causing the number of undos to double in number.
I think I added a status update during the cloning process, maybe it was already there, not sure.
Use pure math for point normal calculations which removes 2 extra undos for each object.
New tool usage - select the items to clone then add the target to the selection and press Start
"And why are their Control In attribute exported out to the parent?"
I don't see that at all
The process still generates a large number of undos. Which is an improvement since before it was a crazy number of undos.
- Attachments
-
- pointCloneScript40.RsObj
- (157.18 KiB) Downloaded 122 times
Re: Final trueSpace 7.61 Beta 8 Unofficial Update
true = 3Dclintonman wrote: ↑01 Apr 2021, 00:55 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.
false = 2D
If you are referring to the command I posted as "Long", that is what is displayed in the Command console when you run the "Short" command
They both do the same thing
For 3D Encapsulate I am using:
var Name = params.ConValue('Name')
LE.CreateEncapsulationNode("",Name,0,0,true)
OnDefaultValue
params.Param('vtData') = "Object";
Re: Final trueSpace 7.61 Beta 8 Unofficial Update
@Clinton
Unencapsulate.xml
Notice this is running when nothing is selected
I added:
var selCount = Node.SelectedCount();
if(selCount == 0) return;
Also added:
if(!IsValidSelection(selectionString)) return;
Also added:
utilityFunctions = System.CreateDO("Clintons3D Package/Utility functions");
utilityFunctions.SetStatusMessage("2D Unencapsulation complete", 4000);
Is this correct?
Should there be something added for NURBS?
Unencapsulate.xml
Notice this is running when nothing is selected
I added:
var selCount = Node.SelectedCount();
if(selCount == 0) return;
Also added:
if(!IsValidSelection(selectionString)) return;
Also added:
utilityFunctions = System.CreateDO("Clintons3D Package/Utility functions");
utilityFunctions.SetStatusMessage("2D Unencapsulation complete", 4000);
Is this correct?
Should there be something added for NURBS?
Code: Select all
function Execute(params)
{
var selectionString = Node.Selection();
var selectionArray = selectionString.split(";");
var re = /^\s/; // whitespace in first character position
var selCount = Node.SelectedCount();
if(!IsValidSelection(selectionString)) return;
if(selCount == 0) return;
if(selectionArray.length < 1) return;
for(var i=0;i<selectionArray.length;i++) {
//remove whitespace from the node path
selectionArray[i] = selectionArray[i].replace(re,"");
if(Node.SubObjectCount(selectionArray[i]) > 0) {
LE.Unencapsulate(selectionArray[i]);
}
}
utilityFunctions = System.CreateDO("Clintons3D Package/Utility functions");
utilityFunctions.SetStatusMessage("2D Unencapsulation complete", 4000);
}
function IsValidSelection(selection)
{
if(!selection) return false;
var reWhiteSpace = /^\s/; // whitespace in first character position for cleaning selection text
var selectionArray = selection.split(";");
for(var i = 0; i < selectionArray.length; i++) {
var selClean = selectionArray[i].replace(reWhiteSpace, "");
if(!Node.Exists(selClean)) {
return false;
}
}
return true;
}
Re: Final trueSpace 7.61 Beta 8 Unofficial Update
Seems faster!clintonman wrote: ↑01 Apr 2021, 01:27 Point Clone script
tS bridge tools recommended by tB
changed the way the tool works because the Selection Change Event was causing the number of undos to double in number.
I think I added a status update during the cloning process, maybe it was already there, not sure.
Use pure math for point normal calculations which removes 2 extra undos for each object.
New tool usage - select the items to clone then add the target to the selection and press Start
"And why are their Control In attribute exported out to the parent?"
I don't see that at all
The process still generates a large number of undos. Which is an improvement since before it was a crazy number of undos.
Still have the scripts with the Control In exported out along with all of the attributes
Re: Final trueSpace 7.61 Beta 8 Unofficial Update
I fixed the Point Clone by 2D Encapsulating the scripts, Watch Dogs, and named it Scripts
I changed all of the paths in the code to include Scripts
In the CleanIt function I added:
var dontSelectArray = []
dontSelectArray.push("Scripts");
dontSelectArray.push("Transform")
and committed out the others
I changed all of the paths in the code to include Scripts
In the CleanIt function I added:
var dontSelectArray = []
dontSelectArray.push("Scripts");
dontSelectArray.push("Transform")
and committed out the others
- clintonman
- Captain
- Posts: 5430
- 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
Looks like it should work. You can simplify a bit like below.trueBlue wrote: ↑01 Apr 2021, 16:18 @Clinton
Unencapsulate.xml
Notice this is running when nothing is selected
I added:
var selCount = Node.SelectedCount();
if(selCount == 0) return;
Also added:
if(!IsValidSelection(selectionString)) return;
Also added:
utilityFunctions = System.CreateDO("Clintons3D Package/Utility functions");
utilityFunctions.SetStatusMessage("2D Unencapsulation complete", 4000);
Is this correct?
Should there be something added for NURBS?
Nothing needed for NURBS or anything else, plain 2D unencapsulate shouldn't have any restrictions.
Code: Select all
function Execute(params)
{
var selectionString = Node.Selection();
if(!IsValidSelection(selectionString)) return;
var selectionArray = selectionString.split(";");
var re = /^\s/; // whitespace in first character position
for(var i=0;i<selectionArray.length;i++) {
//remove whitespace from the node path
selectionArray[i] = selectionArray[i].replace(re,"");
if(Node.SubObjectCount(selectionArray[i]) > 0) {
LE.Unencapsulate(selectionArray[i]);
}
}
utilityFunctions = System.CreateDO("Clintons3D Package/Utility functions");
utilityFunctions.SetStatusMessage("2D Unencapsulation complete", 4000);
}
function IsValidSelection(selection)
{
if(!selection) return false;
var reWhiteSpace = /^\s/; // whitespace in first character position for cleaning selection text
var selectionArray = selection.split(";");
for(var i = 0; i < selectionArray.length; i++) {
var selClean = selectionArray[i].replace(reWhiteSpace, "");
if(!Node.Exists(selClean)) {
return false;
}
}
return true;
}
- clintonman
- Captain
- Posts: 5430
- 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
The encapsulation stopped the scrubbers from updating the other values. When you drag Min the values for MinX, MinY and MinZ will update. Same for Max and the other unlabeled scrubbers.trueBlue wrote: ↑01 Apr 2021, 22:11 I fixed the Point Clone by 2D Encapsulating the scripts, Watch Dogs, and named it Scripts
I changed all of the paths in the code to include Scripts
In the CleanIt function I added:
var dontSelectArray = []
dontSelectArray.push("Scripts");
dontSelectArray.push("Transform")
and committed out the others
PCG Flattened node.png
The attached includes the missing deletions to give a final clean node in the scene.
Code: Select all
//dontSelectArray.push("uniformValues");
dontSelectArray.push("uniformYaw");
dontSelectArray.push("uniformY");
dontSelectArray.push("uniformZ");
dontSelectArray.push("uniformPitch");
dontSelectArray.push("uniformRoll");
dontSelectArray.push("uniformX");
dontSelectArray.push("uniformScaleMax");
dontSelectArray.push("uniformScaleMin");
- Attachments
-
- pointCloneScript42.RsObj
- (157.79 KiB) Downloaded 122 times
Re: Final trueSpace 7.61 Beta 8 Unofficial Update
Clean Up works good now
Simple scene, two Cubes as Source, Plan with 20x10 segments as Target, works good
Change the Plan with 50x20 segments as Target, causes trueSpace to run out of memory and crashes
Wonder if you could add an Esc process?
Simple scene, two Cubes as Source, Plan with 20x10 segments as Target, works good
Change the Plan with 50x20 segments as Target, causes trueSpace to run out of memory and crashes
Wonder if you could add an Esc process?
- clintonman
- Captain
- Posts: 5430
- 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
I'll see what i can do. For sure it looks like some kind of limit needs to be in place. tS can only handle so many nodes at once.
Re: Final trueSpace 7.61 Beta 8 Unofficial Update
If I commit out
// CleanIt(owner);
and disconnect the Pause Activity
I can run Point Clone on a Target Plane with many Segments with no crash and it is super fast
Of course this only copies the objects to the Target without 3D Encapsulating
If I select all of these copies and 3D Encapsulate them, trueSpace crashes! Partial PlayerD3D.log
I used your
for the Magic Scuplturer in tS761 Standalone
No errors!
I notice Peter is using:
var a = System.CreateDO("Common Data Package/Boolean Array Data");
verses 3D Encapsulating?
It created 9473 objects without a crash, but a bit slow
// CleanIt(owner);
and disconnect the Pause Activity
I can run Point Clone on a Target Plane with many Segments with no crash and it is super fast
Of course this only copies the objects to the Target without 3D Encapsulating
If I select all of these copies and 3D Encapsulate them, trueSpace crashes! Partial PlayerD3D.log
[RsD3DDeviceManager.cpp(340)]
000000931500 LOG Renderer: Send restore device [RsD3DRenderer.cpp(266)]
000000931500 LOG WRT D3DWindowedRT_657 : OnLost [RsD3DWindowedRenderTarget.cpp(100)]
000001230828 LOG Renderer: Setting the lost state [RsD3DRenderer.cpp(284)]
000001232359 LOG Renderer: Send device lost [RsD3DRenderer.cpp(250)]
000001232359 LOG WRT D3DWindowedRT_657 : OnLost [RsD3DWindowedRenderTarget.cpp(100)]
000001232594 WARN Direct3D Device could not be restored (hRes = 8007000e), please save your work and restart the application [RsD3DDeviceManager.cpp(1253)]
I used your
Code: Select all
if(typeof(tSBridge) != "undefined") {
bEventsBlocked = tSBridge.RsTSEventsStatus();
tSBridge.BlockRsTSEvents(true);
}
No errors!
I notice Peter is using:
var a = System.CreateDO("Common Data Package/Boolean Array Data");
verses 3D Encapsulating?
It created 9473 objects without a crash, but a bit slow