That's the opposite of what it does. If an unused material, an orphan, exists it removes it. It doesn't add or create missing materials.trueBlue wrote: ↑21 Nov 2023, 18:44This does not seem to work when the Materials node does not existclintonman wrote: ↑21 Nov 2023, 06:03 Remove Orphan Materials
Works properly with scene instanced materials
Removes unused scene materials
Fixes issue, steps below:
create object with 3 different colors
point edit select the last 2 color faces and separate them out from the mesh
remove orphans
result is the first material will turn white or if scene instancing is used the object navigation widget will disappear along with part of the 2 color object
replace "Fix Orphan Materials" inside of /Material Editor/Material Editor/D3D Material Converter/Fix Orphan Materials
Requires Clintons3dPlugin.rsx v1638445 (Oct 13 2023) or greater
Steps
Add Cube and Scene Instance
Delete the Materials node
Cube turns White
Run the Fix Orphan Materials script
Alert: "No orphaned Materials found in this scene"
trueSpace 7.61 Unofficial Update Patches
- clintonman
- Captain
- Posts: 5432
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
- Contact:
Re: trueSpace 7.61 Unofficial Update Patches
- clintonman
- Captain
- Posts: 5432
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
- Contact:
Re: trueSpace 7.61 Unofficial Update Patches
UUFunctionSet Copy and Delete
This is a combination rsx plugin and script update that allows running the original trueSpace copy and delete without using script buffers.
The plugin has new commands added:
GetNodeValueInt will work like Node.Value for integers, but it will work inside toolbar buttons and function sets
GetNodeValueFloat for number values is the same - works in toolbar buttons and function sets
GetnodeValueString for text values will also read color values as text and matrix values as text
The GetNodeValueInt is used inside the UUFunctionSet to make running old style Copy and Delete. This was the motivation for these changes. I was following a tutorial and needed to record a macro using the copy, but it didn't record properly because the copy was run via a script buffer which is the only way to read node values in a functions set. The plugin function can be run inside the function set directly and so it can run the Delete directly. And this is compatible with the macro recorder.
The new required rsx plugin can be found here:
http://clintons3d.com/plugins/truespace ... index.html
new UUFunctionSet node with Copy and Delete changes is attached
This is a combination rsx plugin and script update that allows running the original trueSpace copy and delete without using script buffers.
The plugin has new commands added:
GetNodeValueInt will work like Node.Value for integers, but it will work inside toolbar buttons and function sets
GetNodeValueFloat for number values is the same - works in toolbar buttons and function sets
GetnodeValueString for text values will also read color values as text and matrix values as text
The GetNodeValueInt is used inside the UUFunctionSet to make running old style Copy and Delete. This was the motivation for these changes. I was following a tutorial and needed to record a macro using the copy, but it didn't record properly because the copy was run via a script buffer which is the only way to read node values in a functions set. The plugin function can be run inside the function set directly and so it can run the Delete directly. And this is compatible with the macro recorder.
The new required rsx plugin can be found here:
http://clintons3d.com/plugins/truespace ... index.html
new UUFunctionSet node with Copy and Delete changes is attached
- Attachments
-
- UUFunctionSet.RsObj
- (68.17 KiB) Downloaded 37 times
- clintonman
- Captain
- Posts: 5432
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
- Contact:
Re: trueSpace 7.61 Unofficial Update Patches
Material Converter
ui change:
label "D3D Compiled -> D3D Shader" changed to "D3D Base -> D3D Compound"
see manual chapter 2, section 2.8.4 Creating and Editing objects in the Link Editor
bug:
create cube with default material
material converter
D3D Compiled -> D3D Shader
D3D Material -> Instancing
error line 18 SetActiveMaterial
problem is Name value is null not ""
no node to set default value so needed a try catch when reading the name
ui change:
label "D3D Compiled -> D3D Shader" changed to "D3D Base -> D3D Compound"
see manual chapter 2, section 2.8.4 Creating and Editing objects in the Link Editor
bug:
create cube with default material
material converter
D3D Compiled -> D3D Shader
D3D Material -> Instancing
error line 18 SetActiveMaterial
problem is Name value is null not ""
no node to set default value so needed a try catch when reading the name
- Attachments
-
- D3D Material Converter.RsObj
- (800.18 KiB) Downloaded 36 times
Re: trueSpace 7.61 Unofficial Update Patches
This has gone through some changes and has not been released yet
Can you add your updates to this one? There is a new Scene aspect too
Not so sure about the label change
If you read Chapter 5, they use Shaders through out the document
Not seeing Compound
Can you add your updates to this one? There is a new Scene aspect too
Not so sure about the label change
If you read Chapter 5, they use Shaders through out the document
Not seeing Compound
- Attachments
-
- D3D Material Converter.RsObj
- (813.61 KiB) Downloaded 37 times
- clintonman
- Captain
- Posts: 5432
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
- Contact:
Re: trueSpace 7.61 Unofficial Update Patches
Changes added
- Attachments
-
- D3D Material Converter.RsObj
- (813.93 KiB) Downloaded 39 times
- clintonman
- Captain
- Posts: 5432
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
- Contact:
Re: trueSpace 7.61 Unofficial Update Patches
Found another bug in the 3D Unencapsulate scriptsclintonman wrote: ↑31 Oct 2023, 03:15 3D Unencapsulate gave error while using on an older scene. Problem was using an invalid value from the LinkedOutputNode command
beforeafterCode: Select all
//gather list of child nodes, nodes connected to the transform WldMatrix connector var children = []; for(var i = 0; i < numLinkedChildren; i++) { var child = Node.LinkedOutputNode(theTransform, "WldMatrix", i) children.push(child); }
Code: Select all
//gather list of child nodes, nodes connected to the transform WldMatrix connector var children = []; for(var i = 0; i < numLinkedChildren; i++) { var child = Node.LinkedOutputNode(theTransform, "WldMatrix", i) if(child && Node.Exists(child)) { children.push(child); } }
around line 117 it will add 3d groups to the delete list. so if you have nested 3D groups they will get deleted
Code: Select all
//if transform node and is parent
//if(Node.ConExists(newNode, "WldMatrix") && Node.LinkedOutputNodeCount(newNode, "WldMatrix") > 0) {
if(Node.ConExists(newNode, "WldMatrix") && Node.LinkedOutputNodeCount(newNode, "WldMatrix") > 0 && Node.SubObjectCount(newNode) == 0) {
deleteMeList.push(newNode);
continue;
}
- Attachments
-
- 3D Unencapsulate.RsObj
- (20.19 KiB) Downloaded 35 times
-
- 3D Unencapsulate LE.RsObj
- (20.15 KiB) Downloaded 37 times
Re: trueSpace 7.61 Unofficial Update Patches
Where in these scripts can you add the following:clintonman wrote: ↑20 Dec 2023, 22:36Found another bug in the 3D Unencapsulate scriptsclintonman wrote: ↑31 Oct 2023, 03:15 3D Unencapsulate gave error while using on an older scene. Problem was using an invalid value from the LinkedOutputNode command
beforeafterCode: Select all
//gather list of child nodes, nodes connected to the transform WldMatrix connector var children = []; for(var i = 0; i < numLinkedChildren; i++) { var child = Node.LinkedOutputNode(theTransform, "WldMatrix", i) children.push(child); }
Code: Select all
//gather list of child nodes, nodes connected to the transform WldMatrix connector var children = []; for(var i = 0; i < numLinkedChildren; i++) { var child = Node.LinkedOutputNode(theTransform, "WldMatrix", i) if(child && Node.Exists(child)) { children.push(child); } }
around line 117 it will add 3d groups to the delete list. so if you have nested 3D groups they will get deletedreplace the nodes inside "/Scripts/UUCommands/Encapsulate"Code: Select all
//if transform node and is parent //if(Node.ConExists(newNode, "WldMatrix") && Node.LinkedOutputNodeCount(newNode, "WldMatrix") > 0) { if(Node.ConExists(newNode, "WldMatrix") && Node.LinkedOutputNodeCount(newNode, "WldMatrix") > 0 && Node.SubObjectCount(newNode) == 0) { deleteMeList.push(newNode); continue; }
Space.RemEulerTrans(str)
Objects like the following will throw an error:
ERR Source object: /Scripts/UUCommands/Encapsulate/3D Unencapsulate LE Error: Microsoft JScript runtime error Description: Invalid procedure call or argument Error code: 0x800a0005 - (null) Line: 206, Char: 3 Script text: childMatrix = Node.Value(currentChild, "Matrix");
- Attachments
-
- 3D Group.RsObj
- (235.5 KiB) Downloaded 34 times
- clintonman
- Captain
- Posts: 5432
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
- Contact:
Re: trueSpace 7.61 Unofficial Update Patches
Code: Select all
if(isaNURBS(currentChild)) {
childMatrix = Node.Value(currentChild + "/controlPointMesh", "Matrix");
} else {
if(!Node.ConExists(currentChild, "Matrix")) {
Space.RemEulerTrans(currentChild);
}
childMatrix = Node.Value(currentChild, "Matrix");//add 3 lines above this one
}
Re: trueSpace 7.61 Unofficial Update Patches
That area looks like it is for NURBS
How about line 18?
3D Unencapsulate
Not having much luck adding it to the other encaps scripts except the 3D Unencapsulate LE which is the same as above
How about line 18?
3D Unencapsulate
Code: Select all
for (var i = 0; i < numSelected; i++)
{
var currentEncapsed = Node.SelectionGetAt(sel, i);
Space.RemEulerTrans(currentEncapsed)
if(Node.IsCamera(currentEncapsed)) continue;
if(Node.IsLight(currentEncapsed)) continue;
if(Node.SubObjectCount(currentEncapsed) == 0) continue;
if(Node.IsRenderable(currentEncapsed)) continue;
if(isaNURBS(currentEncapsed)) continue;
CleanRenderAttr(currentEncapsed)
UnEncaps(currentEncapsed);
unencapsHappened = true;
}