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
 Rename zones « View previous topic :: View next topic » 
Author Message
AndrewM
PostPosted: Thu Feb 12, 2009 5:31 am    Post subject: Rename zones Reply with quote



Joined: 12 Feb 2009
Posts: 2

Hi there. I would like to be able to reassign Grome's internal reference to a zone. Is this possible at?

I realise that zone names can be changed, but the order of the zones in Grome remains the same.

eg. auto zone creation does this:
Code:

----------------
|12|13|14|15|
----------------
|08|09|10|11|
----------------
|04|05|06|07|
----------------
|00|01|02|03|
----------------


This puts zone 0 in the bottom left. Is it possible to reassign the zones, keeping them in the same position, but making zone 0 top left (with the rest of the zones following in the same order).

ps. I have a custom exporter that I would need to change if I were to do the remapping on export myself.
Back to top
View user's profile Send private message
ALicu
PostPosted: Thu Feb 12, 2009 8:24 am    Post subject: Reply with quote



Joined: 12 Feb 2007
Posts: 1326

Hello,

Yes, you should use a plugin to change the zone names. The best approach would be an utility plugin which can be easily called from Grome Utils menu. I've uploaded such an utility plugin here:

http://www.quadsoftware.com/storage/UtilGridRename.rar

This plugin is called from Utils menu and rename all selected zones based on their grid position (starting from top left corner, but you can change the way the rename goes with left_reference and lower_reference variables in UtilGridRename.cpp). You can also change the zone_name string formatting for a different naming convention (for now it just gives the name xx_yy).

You should be able to recompile the plugin with any C++ compiler and Grome SDK. You have the projects for Visual Studio 2003 and 2005.

Regards,
Adrian L.
Back to top
View user's profile Send private message
AndrewM
PostPosted: Thu Feb 12, 2009 11:37 pm    Post subject: Reply with quote



Joined: 12 Feb 2009
Posts: 2

ALicu wrote:
Hello,

Yes, you should use a plugin to change the zone names. The best approach would be an utility plugin which can be easily called from Grome Utils menu. I've uploaded such an utility plugin here:

http://www.quadsoftware.com/storage/UtilGridRename.rar

This plugin is called from Utils menu and rename all selected zones based on their grid position (starting from top left corner, but you can change the way the rename goes with left_reference and lower_reference variables in UtilGridRename.cpp). You can also change the zone_name string formatting for a different naming convention (for now it just gives the name xx_yy).

You should be able to recompile the plugin with any C++ compiler and Grome SDK. You have the projects for Visual Studio 2003 and 2005.

Regards,
Adrian L.


Thanks for the plugin ALicu, but it's not exactly what I need. It renames the user editable zone names nicely, however I need the internal zones reordered.

I'm currently iterating through each zone to grab the material layers, and then doing some merging and other processing. My processing treats zone index 0 as top left. The zones in some terrain that I currently have, has zone 0 as the lower left in the grid.

I'm not checking, or using, the user editable zone names for selecting the order of the zones (that would require the artists to ensure that zones were named correctly). Just the order that they are already defined (and returned by iTerrainEdProject.GetTerrainZones()).

Is it possible to some how change this internal order?

I would like to change our data, rather than have the exporter select which order to export in, as we have some terrain already created with different ordering (one terrain's zones were created manually, the others with the auto create tool).

I hope this makes sense, and thanks for your help.

Regards,
AndrewM.
Back to top
View user's profile Send private message
ALicu
PostPosted: Fri Feb 13, 2009 7:35 am    Post subject: Reply with quote



Joined: 12 Feb 2007
Posts: 1326

Hello Andrew,

For now there is no way to change the internal node names. Also, we cannot guarantee a specific order of the naming sequencing. You can create a column and then another one and the order would be completely different than creating a row first. I understand that you create the entire grid at once. But there are many ways in which creation can go, so there is no point to guarantee a specific order for the internal names. They are created just to be unique.

What I suggest is to detect the order during export. The artist can give any names (user defined names) and then at export you can use the same mechanism as the one from the plugin I've sent you and detect the grid order of the zones (based on their world positions and bounding boxes). In this way the artist can create the zones in any order. As long as they are in a regular grid (have the same size and are next to each other, edge by edge) you will be able to detect their grid column and row using any origin.

Let me know if this is your case or maybe i got it all wrong Smile

Best Regards,
Adrian L.
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