Planetside Software Forums

General => Terragen Discussion => Topic started by: D.A. Bentley (SuddenPlanet) on April 08, 2019, 11:58:12 AM

Title: Can Not Delete Internal Network Node - Parts shader within Obj Reader Node
Post by: D.A. Bentley (SuddenPlanet) on April 08, 2019, 11:58:12 AM
Has anyone else noticed you can't delete a Parts shader node within an Obj object reader?  Is this normal?  Seems like a bug, since I was able to paste an alternate Parts shader node within the internal network, so now I have two Parts shader nodes in there, and can't delete either one.

I was trying to replace a Parts shader node with a different Parts shader node because I have a bunch of objects with duplicate Parts shaders.  I had to do some manual texture hook ups, and don't want to redo my work 20 times.

Any ideas?

-Derek
Title: Re: Can Not Delete Internal Network Node - Parts shader within Obj Reader Node
Post by: digitalguru on April 08, 2019, 12:53:44 PM
if this is what you mean - you can delete the redundant materials in the .mtl file that accompanies the .obj - see this post:

https://planetside.co.uk/forums/index.php/topic,26432.msg263354.html#msg263354

This will remove any redundant parts nodes when loading the obj.

Title: Re: Can Not Delete Internal Network Node - Parts shader within Obj Reader Node
Post by: D.A. Bentley (SuddenPlanet) on April 08, 2019, 01:33:23 PM
No, thats not what I'm referring too.  Open the attached .tgd file, and disregard the missing textures.  Then try to delete the Parts shader in the Node Network view.  It won't delete.

Also if you go inside either of the City Block objects' internal network you can't delete the Parts shaders in there either.

-Derek
Title: Re: Can Not Delete Internal Network Node - Parts shader within Obj Reader Node
Post by: digitalguru on April 08, 2019, 03:10:28 PM
As far as I know, you can't delete the parts node in Terragen once they've been imported into a scene. I guess the one in the main node window is one you've pasted there as a test.

I just did a quick experiment and edited the .tgd in a text editor:

Renamed the nodes B46_Void shader and parts node by adding the text "TO_DELETE" in a Terragen scene first

Then searched for those in the .tgd file and deleted these strings :

Quote<default_shader
            name = "B46_Void shader  TO_DELETE"
            (terragen parameter list in between these lines)
            >
         </default_shader>

and:
Quote<object_part
            name = "B46_Void  TO_DELETE"
            gui_use_node_pos = "1"
            gui_node_pos = "400 180 0"
            gui_group = ""
            part = "B46_Void"
            shader = "B46_Void shader  TO_DELETE"
            >
         </object_part>

So basically the shader code for B46_Void bounded by <default_shader (...) </default_shader>

And the object part bounded by <object_part (...) </object_part>

Re-saved to a new .tgd  file and the part is gone, don't how that will affect the scene without seeing the geo though.

I get into the habit now of checking and editing the .mtl file before I  load it into Terragen



Title: Re: Can Not Delete Internal Network Node - Parts shader within Obj Reader Node
Post by: D.A. Bentley (SuddenPlanet) on April 08, 2019, 03:33:39 PM
OK, thanks for the help digitalguru!  I hope in the future Terragen gets a better way of working with Materials.  By searching the forum it seems a lot of users would appreciate that.

-Derek
Title: Re: Can Not Delete Internal Network Node - Parts shader within Obj Reader Node
Post by: Dune on April 09, 2019, 02:21:53 AM
Select the parts you want to delete, click CTRL+D, then select all to be deleted parts (now double) and hit delete.
Title: Re: Can Not Delete Internal Network Node - Parts shader within Obj Reader Node
Post by: digitalguru on April 09, 2019, 06:53:09 AM
QuoteSelect the parts you want to delete, click CTRL+D, then select all to be deleted parts (now double) and hit delete.

Good workaround!
Title: Re: Can Not Delete Internal Network Node - Parts shader within Obj Reader Node
Post by: D.A. Bentley (SuddenPlanet) on April 09, 2019, 12:40:31 PM
Quote from: Dune on April 09, 2019, 02:21:53 AM
Select the parts you want to delete, click CTRL+D, then select all to be deleted parts (now double) and hit delete.

Are you on a Mac?  This doesn't work on PC Terragen.

-Derek
Title: Re: Can Not Delete Internal Network Node - Parts shader within Obj Reader Node
Post by: digitalguru on April 09, 2019, 12:56:03 PM
QuoteThis doesn't work on PC Terragen.

I tried it on your scene on a PC - it deleted the parts inside the obj node,, but didn't delete the parts shader in the top level of the node window - I suspect something went astray with the scene when that node got pasted there?
Title: Re: Can Not Delete Internal Network Node - Parts shader within Obj Reader Node
Post by: Dune on April 09, 2019, 01:27:25 PM
I work on Windows, and it works for me.
Title: Re: Can Not Delete Internal Network Node - Parts shader within Obj Reader Node
Post by: D.A. Bentley (SuddenPlanet) on April 09, 2019, 01:44:20 PM
So you simply select a Parts shader and duplicate it (Ctrl-D), then select both the original Parts shader, and the new duplicate and hit the Del key and they both are removed?

If thats the case, what version of TG4 are you on? 

-Derek
Title: Re: Can Not Delete Internal Network Node - Parts shader within Obj Reader Node
Post by: Dune on April 10, 2019, 02:08:20 AM
Works on all versions.
Title: Re: Can Not Delete Internal Network Node - Parts shader within Obj Reader Node
Post by: bobbystahr on April 10, 2019, 11:27:26 AM
that's the oddest thing I've ever seen..neat work around.
Title: Re: Can Not Delete Internal Network Node - Parts shader within Obj Reader Node
Post by: D.A. Bentley (SuddenPlanet) on April 10, 2019, 01:16:32 PM
I'm not having difficulty with deleting individual parts within the Parts shader.  I'm referring to deleting the entire Parts shader (parent) itself.

If you have a work around for that even better.  ;)  Ideally this should be fixed, as it is not consistent behavior, and should be considered a bug.

-Derek
Title: Re: Can Not Delete Internal Network Node - Parts shader within Obj Reader Node
Post by: sboerner on April 10, 2019, 02:06:55 PM
Aside from being unable to delete the old Parts shader, does replacing it with a new one work?

Perhaps a Parts shader can't be deleted because its internal network is based on the mesh's shading groups (parts), which are fixed. It's not *meant* to be edited or replaced. (By doing so you could easily break the network.)

But . . . have you tried replacing the nodes by editing the .tgd file in a text editor, as a test?

Interesting thread.
Title: Re: Can Not Delete Internal Network Node - Parts shader within Obj Reader Node
Post by: Oshyan on April 10, 2019, 04:57:17 PM
It  is indeed and exactly not meant to be replaced, because it is derived automatically from the object upon load and there are no tools built-in to Terragen to edit or recreate those things.

- Oshyan
Title: Re: Can Not Delete Internal Network Node - Parts shader within Obj Reader Node
Post by: D.A. Bentley (SuddenPlanet) on April 10, 2019, 07:25:21 PM
OK, my main reason for trying to remove/delete a Parts shader was because I wanted to make some materials I could copy and paste to other objects, and also use some materials from the Planetside share that come as tgc or tgd files.  How Do I hook up previously prepared materials is mainly what I need to know.

-Derek
Title: Re: Can Not Delete Internal Network Node - Parts shader within Obj Reader Node
Post by: Matt on April 10, 2019, 08:14:07 PM
If you know that the parts names (e.g. material names in the OBJ) will be the same for all objects, you can point all object to the same Parts Shader. You could copy that Parts Shader to the root of the network and I think it should still work.

In situations like this, you can avoid spending lots of time in context menus by remembering that node connections are simply text that you can copy from one properties window to another. So you might put your Parts Shader in the root of the network, and paste "/Parts shader 01" into the Surface Shader field of the object.

Connecting to a shader outside of the object might prevent you from saving the whole package as a TGO, if that's important to you.
Title: Re: Can Not Delete Internal Network Node - Parts shader within Obj Reader Node
Post by: D.A. Bentley (SuddenPlanet) on April 10, 2019, 09:27:20 PM
Thanks Matt/Oshyan,

I'll try this and see how it goes.  Sounds like I was trying to do some things in the network view/node graph that could have been done more easily with a simple Copy-Paste operation.  I've been using PoseRay and manually editing MTL files for quite some time, so getting the MTLs set up beforehand should be pretty easy.

Thanks!

-Derek