www.quadsoftware.com
FAQ  FAQ   Search  Search   Memberlist  Memberlist   Usergroups  Usergroups
Register  ::  Log in Log in to check your private messages


Post new topic  Reply to topic
 Default behaviour for applying things to swapped zones « View previous topic :: View next topic » 
Author Message
duke2
PostPosted: Tue Jun 23, 2009 10:11 am    Post subject: Default behaviour for applying things to swapped zones Reply with quote



Joined: 21 Mar 2008
Posts: 45

Could it be made so that when you try to apply something to a swapped zone (like a texture), it unswaps->applies->swaps, each one? In the meantime, i'll see if this can be done via the scripting engine.

On a related subject, can I apply a texture to a zone without re-doing it's settings? I mean if I just want to apply that texture with the same settings as it currently has.
Back to top
View user's profile Send private message
ALicu
PostPosted: Tue Jun 23, 2009 10:32 am    Post subject: Reply with quote



Joined: 12 Feb 2007
Posts: 1326

Quote:
Could it be made so that when you try to apply something to a swapped zone (like a texture), it unswaps->applies->swaps, each one? In the meantime, i'll see if this can be done via the scripting engine.


We plan to add this in the future (a toggle than when you apply a tool automatical unswap - swap is performed; there are complications though with the borders of the patches).

In the mean time this can be done with the scripting or the SDK. Shape Processing utility plugin is a fine example of this, it applies various scripts on polygonal shape doing automatic swapping and unswapping. Also there is an example script that describes how to do this with minimal unswap zones in memory and in the same time to have all the neighbors of a zone in memory while processing (see GridSwapProcessing.as in Scripts/Examples).

Quote:
On a related subject, can I apply a texture to a zone without re-doing it's settings? I mean if I just want to apply that texture with the same settings as it currently has.


For a layer (or more) you can change its texture by simply clicking it thumbnail. Also you can copy all the layer settings to another one by right clicking it in the Selection tab and selecting "Copy material params to" option.

In case you want to apply the same texture that you have on a zone to another, just go to Global tab and expand the layer. Then press the > button next to the texture and select Fill Selection. This will apply the layer texture and parameters to all the selected zones. The zones that already have a texture for that layer are skipped, so you need to not have a texture assigned to your new zone (or just clear its layer before doing this).

Regards,
Adrian L.
Back to top
View user's profile Send private message
duke2
PostPosted: Wed Jun 24, 2009 11:46 am    Post subject: Reply with quote



Joined: 21 Mar 2008
Posts: 45

Could you add this function to water? Right click on Water selection->Copy water settings to.
Back to top
View user's profile Send private message
ALicu
PostPosted: Wed Jun 24, 2009 11:52 am    Post subject: Reply with quote



Joined: 12 Feb 2007
Posts: 1326

Yes, this will be present in an update (together with fill selection for water).
Back to top
View user's profile Send private message
duke2
PostPosted: Thu Jun 25, 2009 9:41 am    Post subject: Reply with quote



Joined: 21 Mar 2008
Posts: 45

What's the script syntax for g_terrain_editor.AssignLayerToSelection when it's a Heightmap or Selection type, where they don't have parameters? At the moment i'm just giving it a param table with nothing in it but it doesn't seem to be working (the problem may be elsewhere, though).

This is what I added/replaced to GridSwapProcessing:
Code:

void ProcessCurrentZone()
{
   cPropertyTable tNull;
   
   int sLandmass = g_terrain_editor.FindLayer("Selection", "Landmass");
   g_terrain_editor.AssignLayerToSelection(sLandmass, "Selection", tNull);
   
   int hBase = g_terrain_editor.FindLayer("Heightmap", "Base");
   g_terrain_editor.AssignLayerToSelection(hBase, "Heightmap", tNull);
   
  iEditorTool@ tool = gActivateTool("Terrain.SelectionGenerator");
  if(tool != null)
   {
      cParamValue parameter;
      
      tool.SetParam("Selection.operation", parameter, 0);
      tool.SetParam("Terrain.NormalMethod", parameter, 1);
      tool.SetParamString("Altitude.Params", "0", DATATYPE_FLOAT, 0);
      tool.SetParamString("Altitude.Params", "128", DATATYPE_FLOAT, 1);
      tool.SetParamString("Altitude.Params", "64", DATATYPE_FLOAT, 2);
      tool.SetParamString("Slope.Params", "0", DATATYPE_FLOAT, 0);
      tool.SetParamString("Slope.Params", "90", DATATYPE_FLOAT, 1);
      tool.SetParamString("Slope.Params", "0", DATATYPE_FLOAT, 2);

      tool.Run();
   }
}
Back to top
View user's profile Send private message
duke2
PostPosted: Thu Jun 25, 2009 11:26 am    Post subject: Reply with quote



Joined: 21 Mar 2008
Posts: 45

Nevermind, all worked out.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Based on a template by Dustin Baccetti
Powered by phpBB © 2001, 2005 phpBB Group