node naming

Started by mogn, August 01, 2016, 07:19:52 am

Previous topic - Next topic

mogn

create Add scalar (name scalar 01)
create Add scalar (name scalar 02)
delete scalar 01
create Add scalar (name scalar 01)

This means that you have an internal table of used names for each node type.

I have not created more than 100 nodes of same type,
but a 16 bit table for each node should be enough for 128 nodes.

Why do you not use this numbering system when copying nodes?

ajcgi

Yes. Node names are an oldy. Plus I'd like to be able to change their colour as in Nuke. And navigate with a handy navigation window like PS or Nuke. And add dots in the middle of connecting lines... like Nuke. :D  :P

Matt

August 01, 2016, 12:13:42 pm #2 Last Edit: August 01, 2016, 12:22:33 pm by Matt
Quote from: mogn on August 01, 2016, 07:19:52 am
This means that you have an internal table of used names for each node type.


A table that's only indexed by node type wouldn't account for user-edited names. For example, there would still be a clash if you renamed something to look like it's another type of node. Since this kind of table would only solve a subset of the problem, we don't do that.

Terragen searches the node tree (within the scope where they would result in a conflict) for other nodes with the same name as the candidate name, and then iterates the number until no clash occurs.

Quote
Why do you not use this numbering system when copying nodes?


EDIT: See my next post.

Matt
Just because milk is white doesn't mean that clouds are made of milk.

Matt

August 01, 2016, 12:19:53 pm #3 Last Edit: August 01, 2016, 12:23:45 pm by Matt
There is a difference between creating a new node - where the system knows exactly what the number in the name means - and copying a node whose name might mean anything. So at the moment we don't blindly assume that any number in your node name is OK to change to another name. Appending "_1" is safer in that regard, but I realise it's also annoying because it results in things like "_1_1_1_1" after a few copies. Perhaps we can change it to increment any numbers of the form "_n", so the worst that happens is you end up with "Add scalar 01_1", "Add scalar 01_2", "Add scalar 01_3" etc. I think that was the original intention when I first started adding "_1".

Matt
Just because milk is white doesn't mean that clouds are made of milk.

mogn

That would be better than the current naming system.

KyL

That would indeed be a welcome change!