Text-editing translucency values

Started by N-drju, May 06, 2020, 03:41:07 AM

Previous topic - Next topic

N-drju

Guys, do you think it is safe, to open a project file in text editor and set translucency values from there?

The thing is, XFrog trees, by default, do not have any leaf / needle translucency enabled. This basically results in user having to set preferred values on their own... Which takes forever...

Also, it is not possible to just open up an object and then save it again as another, edited object. It looks like XFrog has hard-coded some of the models (quite understandably) to prevent this.

I have found some strings in the .tgd file that are responsible for translucency in objects. I just don't know if it is safe to do it this way. ::) Theoretically, one could just type some values, use the "change all to..." option and save lots upon lots of time that way!
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

Dune

I think it's possible as long as you are certain only the XFrog plants are affected, not translucency in other default shaders. If there are no others, I think it's safe. You could at least try with a copy of your file.

You can save the altered objects as tgc, AFAIK. Import would call the unaltered object, but alter it within that tgc once imported as tgc.

KlausK

Just make a backup copy of your project file and try it 8)

CHeers, Klaus
/ ASUS WS Mainboard / Dual XEON E5-2640v3 / 64GB RAM / NVIDIA GeForce GTX 1070 TI / Win7 Ultimate . . . still (||-:-||)

N-drju

Quote from: KlausK on May 06, 2020, 04:15:18 AMJust make a backup copy of your project file and try it 8)

CHeers, Klaus

You think I didn't already? ;)

It seems to work indeed, but, as Ulco says, one has to make sure that only leaf and needle shaders are affected. Which, still, is a lot of work. Besides, I tried to change the translucency on African Boxwood and my edits had no impact on the object at all...

It's doable, but a hassle nonetheless. I wish there was an easier way to macromanage translucency, but the problem definitely lies within how XFrog objects for TG are made.
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

cyphyr

I do this all the time.
Very useful when you have multiple values that all need to be changed at the same time, a simple search and replace does the job very quickly.

(There are other text editor hacks you can do too, like changing imported FBX nulls incl animated nulls to point lights).
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 5950X OC@4Ghz, 64Gb (TG4 benchmark 4:13)

N-drju

I'm convinced now. I'll start doing it starting with the next project (that being the contest). Could take some practice to find appropriate chunks of information though. And of course, it could be helpful to create some nice greenish hues, save them, then copy-paste as necessary.
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

jaf

You also might want to try the text editor Sublime Text -- https://www.bing.com/search?q=sublime+text&PC=U316&FORM=CHROMN
It's free to evaluated without a time limit.  When you load your tgd file, set the View|Syntax to XML and it will color code like the image below.
(04Dec20) Ryzen 1800x, 970 EVO 1TB M.2 SSD, Corsair Vengeance 64GB DDR4 3200 Mem,  EVGA GeForce GTX 1080 Ti FTW3 Graphics 457.51 (04Dec20), Win 10 Pro x64, Terragen Pro 4.5.43 Frontier, BenchMark 0:10:02

WAS

Hmm

Because there are more than one default shader per plant, this really is just going to be work too.

The best route I can think of considering the circumstances is working in a new project, loading the trees you want as a single model (not pop) and than editing and saving them "[filename]-modified.tgo". Than you can load it up in any population in any project with the fixes are present without the work again.

Other than that I'd only go extreme from there if it was so prudent. I'd probably write a PHP XML parser, and just gather a list of default shaders and checkboxes and input values for translucency. Then check all that apply and have it edit only those results.

aokcub

I sometimes edit tgd with text editor (i prefer VSCode) to modify values.

As the another way to re-use the setting, we can save shaders as tgc.
Clip default shaders and import them in a new project.

WAS

Quote from: aokcub on May 06, 2020, 03:48:02 PMI sometimes edit tgd with text editor (i prefer VSCode) to modify values.

As the another way to re-use the setting, we can save shaders as tgc.
Clip default shaders and import them in a new project.

He can just save the whole model as a new TGO or OBJ to save the trouble ever again in the future. I always prepare objects for Terragen prior to using them anyway so I don't encounter this issue. No obj is just going to import into TG right, unfortunately.

aokcub

Quote from: WAS on May 06, 2020, 03:50:46 PMHe can just save the whole model as a new TGO or OBJ to save the trouble ever again in the future.


Ah, i see. :)
Just wondering, how can we do if the original model is TGO?
I believe OBJ reader can export model as TGO/OBJ but TGO reader cannot. (Please correct me if I am wrong.)

WAS

TGO reader can export back to OBJ.

---

Here's a quick screen grab of cycling a project file for default shaders and listing translucency. Once could target leaves or needles, either manual selections or procedurally, and change the values accordingly via manual input or procedurally.

N-drju

I am aware of this possibility. However, as I mentioned in the first post, some objects simply cannot be saved anew. Must be some hardcoded form of protection.
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

WAS

Ah yes, old xfrog TGOs. A mistake on their part honestly. I always get OBJ format. TGO is just a glorified OBJ format with ability to save shader networks. Not sure why they decided to lock those old files.

I am pretty sure you can still save the populations as clips.

aokcub

Yes since I mainly use Xfrog so I didn't notice that tgo can be exported from right-click menu.
I tried with another tgo and found that export feature works. Thank you WAS.