Made some modifications in Clinton's
Show script that is included in the Unofficial Updates.
Wanting to create a different way that stops the Object Render Attributes panel from showing in Settings
This works for single objects:
Code: Select all
function Execute(params)
{
Nsel = Node.SelectedCount()
SelArray = new Array(Nsel)
for (i=0; i<Nsel; i++)
{
SelArray[i] = Node.Selected(i)
}
for (i=0; i<Nsel; i++)
{
Sel = SelArray[i]
Node.Select(Sel)
if(!Node.ConExists(Sel, "WldMatrix")) return;
if(!Node.Exists(Sel + "/Object Render Attributes"))
for (j=0; j<Nsel; j++)
{
Node.Delete(Sel + "/OwnerName")
Node.Create('Kernel Package/OwnerName', Sel + "/")
// D3DView.ShowRenderAttribsForObject('','')
Node.Delete(Sel + "/Object Render Attributes")
RsFileIO.LoadObject(System.GetMainDir() + "\\Scripts\\preobjects\\ObjectAttributes.rsobj", Sel + "/")
Node.ConRemove(Sel, "RenderAttributes")
Node.ExportConnector(Sel + "/Object Render Attributes", "RenderAttributes", "", 1, 1)
Node.ConnectTo(Sel + "/OwnerName", "Object Name", Sel + "/Object Render Attributes", "Object_Name")
Node.Value(Sel + "/Object Render Attributes", "Invisible") = 0
}
if(!Node.ConExists(Sel + "/Object Render Attributes", "Object_Name"))
for (j=0; j<Nsel; j++)
{
Node.Delete(Sel + "/Object Render Attributes")
Node.Delete(Sel + "/OwnerName")
Node.Create('Kernel Package/OwnerName', Sel + "/")
// D3DView.ShowRenderAttribsForObject('','')
Node.Delete(Sel + "/Object Render Attributes")
RsFileIO.LoadObject(System.GetMainDir() + "\\Scripts\\preobjects\\ObjectAttributes.rsobj", Sel + "/")
Node.ConRemove(Sel, "RenderAttributes")
Node.ExportConnector(Sel + "/Object Render Attributes", "RenderAttributes", "", 1, 1)
Node.ConnectTo(Sel + "/OwnerName", "Object Name", Sel + "/Object Render Attributes", "Object_Name")
Node.Value(Sel + "/Object Render Attributes", "Invisible") = 0
}
if(Node.ConExists(Sel + "/Object Render Attributes", "Object_Name"))
for (j=0; j<Nsel; j++)
{
Node.Delete(Sel + "/OwnerName")
Node.Delete(Sel + "/Object Render Attributes")
Node.Create('Kernel Package/OwnerName', Sel + "/")
// D3DView.ShowRenderAttribsForObject('','')
Node.Delete(Sel + "/Object Render Attributes")
RsFileIO.LoadObject(System.GetMainDir() + "\\Scripts\\preobjects\\ObjectAttributes.rsobj", Sel + "/")
Node.ConRemove(Sel, "RenderAttributes")
Node.ExportConnector(Sel + "/Object Render Attributes", "RenderAttributes", "", 1, 1)
Node.ConnectTo(Sel + "/OwnerName", "Object Name", Sel + "/Object Render Attributes", "Object_Name")
Node.Value(Sel + "/Object Render Attributes", "Invisible") = 0
}
if(Node.Exists(Sel + "/Object hider"))
for (j=0; j<Nsel; j++)
{
Node.Disconnect(Sel + "/Object hider", "Invisible", Sel + "/Object Render Attributes", "Invisible")
Node.ConnectTo(Sel + "/Object hider", "Invisible", Sel + "/Object Render Attributes", "Invisible")
}
if(Node.ConExists(Sel, "Input Attributes"))
for (j=0; j<Nsel; j++)
{
Node.ConRemove(Sel, "Input Attributes")
}
if (Node.ConExists(Sel, "LightAttributes"))
for (j=0; j<Nsel; j++)
{
Node.Value(Sel + "/Object Render Attributes", "Cast shadows") = 0
Node.Value(Sel + "/Object Render Attributes", "Receive shadows") = 0
Node.Disconnect(Sel + "/Object hider", "Invisible", Sel + "/Object Render Attributes", "Invisible")
Node.ConnectTo(Sel + "/Object hider", "Invisible", Sel + "/Object Render Attributes", "Invisible")
}
if (Node.ConExists(Sel, "Camera"))
for (j=0; j<Nsel; j++)
{
Node.Value(Sel + "/Object Render Attributes", "Cast shadows") = 0
Node.Value(Sel + "/Object Render Attributes", "Receive shadows") = 0
Node.Disconnect(Sel + "/Object hider", "Invisible", Sel + "/Object Render Attributes", "Invisible")
Node.ConnectTo(Sel + "/Object hider", "Invisible", Sel + "/Object Render Attributes", "Invisible")
Node.ConRemove(Sel, "Object Name")
Node.ExportConnector(Sel + "/OwnerName", "Object Name", "", 1, 1)
}
}
}
But does not work for Encapsulated objects!
WIP:
Code: Select all
function Execute(params)
{
var Sel = Node.Selection()
if(!Node.ConExists(Sel, "WldMatrix")) return;
if(Node.Exists(Sel + "/Object Render Attributes") || (Node.Exists(Sel + "/RenderAttributes")))
{
Node.Delete(Sel + "/Object Render Attributes")
Node.Delete(Sel + "/RenderAttributes")
Node.ConRemove(Sel,"Input Attributes")
}
D3DView.ShowRenderAttribsForObject('','')
/*
TODO:
Modify the above for multiple selections
Remove --> D3DView.ShowRenderAttribsForObject('','')
if(!Node.Exists(Sel + "/Object Render Attributes"))
{
Node.Delete(Sel + "/Object Render Attributes")
RsFileIO.LoadObject(System.GetMainDir() + "\\Scripts\\preobjects\\ObjectAttributes.rsobj", Sel + "/")
Node.ConRemove(Sel, "RenderAttributes")
Node.ExportConnector(Sel + "/Object Render Attributes", "RenderAttributes", "", 1, 1)
}
if(!Node.Exists(Sel + "/RenderAttributes"))
{
Node.Create("Space 3D Package/RenderAttributes", Sel + "/")
Errror...
Node.ExportConnector(Sel + "/RenderAttributes", "InputAttributes", "", 1, 1)
Node.ExportConnector(Sel + "/RenderAttributes", "RenderAttributes", "", 1, 1)
Node.ConnectTo(Sel + "/Object Render Attributes", "RenderAttributes", Sel, "Input Attributes")
}
TODO: Connect/Export -- > RenderAttributes node
*/
}