Paint Material in Play Mode

There are no stupid questions, just stupid answers.
23 posts Page 1 of 3
subabrain
Posts: 136
Joined: Sat Aug 20, 2016 4:58 pm
 
  by subabrain » Wed Nov 15, 2017 12:52 pm
Hi there,

sorry for my Question ... i try to exec the following function in play mode:

ETerrainEditor.autoMaterialLayer(-10000, 10000, 0, 90, 100);

now i execute this function in the console window.
it doenst work - but if i try in editor mode it works.

Maybe u can help me with that - Thanks a lot!

Greetz
Robert
Duion
Posts: 845
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Wed Nov 15, 2017 6:46 pm
What are you trying to achieve? The auto paint function is resource intensive.
subabrain
Posts: 136
Joined: Sat Aug 20, 2016 4:58 pm
 
by subabrain » Thu Nov 16, 2017 10:46 am
Hello,

i just want to check if i can use paint methods in the play mode :)

Thanks a lot!

Greetings
Robert
Duion
Posts: 845
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Thu Nov 16, 2017 11:38 am
So you found out now that you cannot.
subabrain
Posts: 136
Joined: Sat Aug 20, 2016 4:58 pm
 
by subabrain » Thu Nov 16, 2017 12:39 pm
Hi,

thanks for your answer :)

is there a opportunity to fade out the panels in the editor mode?

would be nice to hear from you - thanks a lot!

Greetz
Robert
LukasPJ
Site Admin
Posts: 358
Joined: Tue Feb 03, 2015 7:25 pm
 
by LukasPJ » Thu Nov 16, 2017 8:53 pm
@
User avatar
subabrain


Sure it's possible to paint the terrain. In T3D, there really is no difference between "play mode" and "edit mode". It's the same mode, just different UI.

However, I would have to question whether it is the best solution to whatever you are trying to achieve.
As Duion mentioned, it's really resource intensive and the terrain is not designed to be repainted during play. If you are doing a singleplayer-only game it is definetly not too big of a task to implement however.

You should consider whether decals is the better solution to your problem however, as it is networked, more efficient and allows for a higher level of detail.
LukasPJ
Site Admin
Posts: 358
Joined: Tue Feb 03, 2015 7:25 pm
 
by LukasPJ » Thu Nov 16, 2017 9:05 pm
This might point you in the right direction:

https://github.com/GarageGames/Torque3D ... #L197-L247

Don't know for sure, as I haven't done it before.
subabrain
Posts: 136
Joined: Sat Aug 20, 2016 4:58 pm
 
by subabrain » Thu Nov 16, 2017 9:52 pm
Hi,

thanks a lot - i would give a try - but i dont know what the parameter "Selection * sel" means?

thanks!

Greetings
Robert
LukasPJ
Site Admin
Posts: 358
Joined: Tue Feb 03, 2015 7:25 pm
 
by LukasPJ » Sat Nov 18, 2017 9:14 am
Alright so that code is meant to be used with the terrain painter, which has a big brush which is the "Selection".

A guess for an implementation is, based on the above code is:
https://hastebin.com/afuxekalay.php
(I did NOT test this, and it is likely riddled with issues and syntactical errors.)

I ripped out all the logic for selection, brushes and slopes and just made the logic for a single point.
I'm not sure whether having a reference to a TerrainEditor is the best way to go, I think it would be better to avoid that and get the terrain directly. But the TerrainEditor already has most of the logic.
subabrain
Posts: 136
Joined: Sat Aug 20, 2016 4:58 pm
 
  by subabrain » Sat Nov 18, 2017 9:47 am
Hello LukasPJ,

THANKS A LOT!

ill try it today 8-)

Best Regards!
Robert
23 posts Page 1 of 3

Who is online

Users browsing this forum: No registered users and 1 guest