Script tg_splatter_craters.py

Started by Kevin Kipper, January 14, 2025, 06:48:19 PM

Previous topic - Next topic

RichTwo

Thanks for the quick reply, Kevin. I believe I am running it as intended but only using tg-splatter-craters. Not sure about the tg-dashboard; I just open it from its folder, and I get the control panel.  I am then able to create a scene with multiple craters of varying sizes, in fact I just did. The control panel appeared on screen but again it and the icon on the taskbar unexpectedly disappeared while I was on TG and not using the panel. It has not yet crashed while I was using it. Version 3.13.1 is what the cmd prompt shows.
They're all wasted!

Kevin Kipper

Thanks for the feedback! Are you running Windows or Mac?  

Just to clarify the steps you're taking; you're running the script directly by clicking on it.  It runs fine and you're able to add craters to the project.  Then you leave the script running, and click on something in the Terragen UI and the script closes (crashes) all on its own?  You then have to re-run the script in order to add more craters.

If that is what you're experiencing, there's something not quite right.  In Windows 10, I can definitely leave the script window open, modify anything in Terragen, and come back to the script and add more craters.  There are situations in which a script may not know of new changes made in Terragen, and then try to update something that's no longer there, but that doesn't sound like what's happening here.  

I'll have to ask Matt about this one!

RichTwo

In answer to what system I've got, it's Windows 10. And yes, I do and click directly on the icon in its folder, and it happens exactly the way you described it. The py script otherwise seems to work as designed. 

I don't know if it is of any use to know, but about a year ago I had uninstalled the antivirus program (Norton 360) because it bogged down almost everything I tried to do on the computer. I'm relying solely on Defender now. My machine is still old and slow (like me...  ::)) but far better than what it was.
They're all wasted!

Doug

It would seem that i have 10 Craters close to each other. I will work on that, but it seems to work.

My problem is when it 'attempts" to connect the added Craters, they are all on top  of each other.
Not nice like your picture.

If desired, the Crater shaders can be inserted into the node network workflow. The "Output > Main input" option will attempt to connect the added Crater shaders in between the first Compute terrain node in the project and whatever shader was assigned to its Main input when the Apply button is clicked.  The "Merge shader" option will attempt the same via a Merge shader node.  When the "Don't" option is chosen, no attempt is made to connect the Crater shaders to the existing node network.

Kevin Kipper

#19
Haha.  Yes, about that.  So when RPC adds a node to the project it's positioned in the center of the Node Network pane.  I've gotten into the habit of moving the Node Network view to where I want the nodes to appear.  Now RPC will still stack the nodes on top of each other, but they're a little easier to deal with, rather than stacking up on some part of the node network that you don't want them to be, like the Atmosphere group.

You mentioned you had 10 Crater nodes close to each other, but imagine you had 100.  What a job that would be to unravel and reposition them.  This is the type of situation that scripting is great for, i.e. repetitive tasks.  I've already written a script that unravels selected nodes.  I haven't released it to the public yet, but I use it all the time.  I simply select the entire cluster of nodes that are stacked on top of each other and run the script.  It basically repositions the nodes vertically so they're not on top of each other.  It's then much easier to move the entire group of crater nodes where you want in the node network view.  That's how I got the "nice" look in the example images.

As soon as I'm done with the current scripting project we're working on, I'll get a version of the unraveling script posted so you can use it.

I've been thinking about how to incorporate what the unraveling script is doing, so that it can be added to other scripts like a function call.  That way the nodes would be better aligned to begin with.

Just so you know, the node connections are correct; the nodes are just stacked on top of each other.

Doug

it says number of craters 10

the 100 number also determines the number of craters?

Doug

never mind

you said imagine


RichTwo

An update: After a few days of my not attempting to use this function, I tried again. This time there was no issue with it crashing, at least not yet. To test it further, I aborted a project and started anew. The control panel remained open, and as I write this, it still is after more than an hour. That tells me either it was my old machine or a fix was found. I'm betting all on the former, since there hasn't been any further discussion in this thread.
My apologies if this caused any head scratching and futile searches for a problem amongst the Planetside Staff. I was mostly curious if anyone else experienced it. Apparently, it was just little ol' me...  :P
They're all wasted!

Kevin Kipper

No worries.  The only update we've made to any of the scripts is to bundle them together in the redmaw-tg-toolkit.  For those specific scripts we've tried to update the UI so that when the script is run on the MacOS it looks similar to when it is run on Windows.