Page 1 of 3

Blender->Spring Feature script

Posted: 27 Aug 2012, 06:29
by enetheru
Github: https://github.com/enetheru/springrts-blender-tools

Hey guise,

I was frustrated at the continual boiler plate stuff I was going through to work with features.. I just wanted to put some art in the game and not write description files etc. especially considering its a bunch of copy pasta bleh.. anyway.. enjoy

http://youtu.be/F9dCZGfRRWQ

I'm still working on it as you can see by the ToDo at the end of the vid.
and I think I code pretty badly so if anyone wants the scripts I've been writing I can host them on github if there is interest.

Re: Blender->Spring Feature script

Posted: 28 Aug 2012, 05:35
by enetheru
so because of the UV map needing to be flipped etc, i decided that flipping the texture was easier, i already had to reprocess the textures due to the weird channel layouts needed..

anway
here's the image of my node setup that re-orders channels and flips the image to take care of the inverted Y axis of UV's

with this I can work in blender natively, using an RGBA image for what is the usual expectations, and push out the images needed for the feature.

Image

Re: Blender->Spring Feature script

Posted: 28 Aug 2012, 07:51
by rattle
or you could work with DDS textures and skip UV flipping... wondering why after all this time spring does not flip UVs internally.

Re: Blender->Spring Feature script

Posted: 28 Aug 2012, 07:58
by enetheru
rattle wrote:or you could work with DDS textures and skip UV flipping... wondering why after all this time spring does not flip UVs internally.
Its just using a different coordinate space, blender uses bottom left as 0,0, spring uses top left. its not technically incorrect in anyway, just different.

Also, regarding DDS I haven't found any simple FLOSS tools to work with DDS textures that are available without difficulty on Linux.

Edit: On Windows blender can output to DDS

Re: Blender->Spring Feature script

Posted: 28 Aug 2012, 10:27
by rattle
some insight by people who know better than I

Re: Blender->Spring Feature script

Posted: 28 Aug 2012, 11:01
by enetheru
rattle wrote:some insight by people who know better than I
insert relevant futurama fry meme

Re: Blender->Spring Feature script

Posted: 28 Aug 2012, 14:17
by Kloot
http://i.imgur.com/io1g0.png

Please tell me you did not reinvent the wheel writing your own hierarchy/metadata exporter.
Also, regarding DDS I haven't found any simple FLOSS tools to work with DDS textures that are available without difficulty on Linux.
tried nvidia's texture tools?

Re: Blender->Spring Feature script

Posted: 28 Aug 2012, 16:10
by enetheru
Kloot wrote:Please tell me you did not reinvent the wheel writing your own hierarchy/metadata exporter.
by that you mean that there existed a blender object heirarchy exporter already that is current? is so link please :)

Either way it wasn't much effort and got me actually coding again since forever.
Kloot wrote:tried nvidia's texture tools?
ubuntu user here, pretty sure.. wait.. checking.. ZOMG nvidia-texture-tools is in main respository.. awesome :mrgreen: .

hrm.. this makes things interesting.. pretty sure i will completely re-think the texture options and use imagemagick to compose the source textures into tex1 and tex2 formats then nvcompress to spit out the dds files.. it cleans up a few things.. and if it takes care of the V flipping issue then i can forget about that too.. thanks for the prod.

Re: Blender->Spring Feature script

Posted: 31 Aug 2012, 16:54
by enetheru
So it took a ridiculous amount of bullshitting around with imagemagick and i now have a healthy hatred for it.

but here's my little script that takes input images and spits out the two textures for ingame..

I'm sure some professionals will look at it and be disgusted, but I'm still fairly amateur.

there are probably lots of use cases it will fail in, but meh, its a start.. and it was entertaining.
texconvert.txt
(4.7 KiB) Downloaded 55 times

Re: Blender->Spring Feature script

Posted: 05 Sep 2012, 16:47
by enetheru
http://youtu.be/KVYLIR61PXA

so here's a quick and dirty update, basically dynamic editing of colission and occlusion volumes with auto calculation of size etc..

I need to get to sleep.. but the coffee keeps me awake... gahhh

I will make a better video showing end to end usage. and list things I want to fix.

Re: Blender->Spring Feature script

Posted: 05 Sep 2012, 22:01
by Beherith
Rofl, imagemagick is one of those things I have a love-hate relationship with :)
by the way, does your script also do import?

Re: Blender->Spring Feature script

Posted: 05 Sep 2012, 23:32
by enetheru
Beherith wrote:Rofl, imagemagick is one of those things I have a love-hate relationship with :)
by the way, does your script also do import?
not yet. but its on the cards.

Re: Blender->Spring Feature script

Posted: 06 Sep 2012, 02:26
by enetheru
https://github.com/enetheru/springrts-blender-tools

I've updated the github repo with my latest.. so check it out and play.. :mrgreen:

Re: Blender->Spring Feature script

Posted: 06 Sep 2012, 02:32
by enetheru
enetheru wrote:https://github.com/enetheru/springrts-blender-tools

I've updated the github repo with my latest.. so check it out and play.. :mrgreen:

and by that i man download the SpringRTS Feature Tools folder to your blender scripts directory and enable the addon.. then play..

Re: Blender->Spring Feature script

Posted: 06 Sep 2012, 04:04
by enetheru
Oh and hears a final video of end to end worlflow which hopefully better illustrates whats happening...

http://youtu.be/wfU4sg-RSqA

I'll stop spamming the boards now.

Re: Blender->Spring Feature script

Posted: 08 Oct 2012, 15:31
by enetheru
Beherith wrote:by the way, does your script also do import?
Been working on it the last few days, pretty basic at the moment.

To begin with I will be loading up what I am exporting, so lua feature defs, mesh hierarchy, obj file, dds textures(and splitting them into usable layers)

Ive cleaned up the code quite a bit and refactored many things. lots to do.

Re: Blender->Spring Feature script

Posted: 17 Oct 2012, 00:48
by wolas
I imagine how hard is to newcomer to do something in spring since even old folks dont know whats already done :/

Re: Blender->Spring Feature script

Posted: 17 Oct 2012, 02:54
by enetheru
wolas wrote:I imagine how hard is to newcomer to do something in spring since even old folks dont know whats already done :/
My philosophy is if it doesn't exist, or is non obvious and I wan't to do it.. I do it. I do it independently(other people are already busy and don't want someone bugging them), this also means being independent of criticism and compliment, reaction or lack thereof to what I do is not a driving factor.

Just wish I could also apply this mentality to picking up girls ;)

Re: Blender->Spring Feature script

Posted: 17 Oct 2012, 08:06
by knorke
you are calling it feature exporter but as I understand it actually exports 3d files?
"Features" in spring-speak would be those things that stand around motionless. (rocks, trees etc)
Compared to units which can be scripted to wiggle. (tanks, mechs etc)
I wonder because for features it makes no sense if their 3d model consists of multiple objects: they can not be animated anyway so everything might as well be combined into one object?

Re: Blender->Spring Feature script

Posted: 17 Oct 2012, 08:20
by enetheru
knorke wrote:you are calling it feature exporter but as I understand it actually exports 3d files?
"Features" in spring-speak would be those things that stand around motionless. (rocks, trees etc)
Compared to units which can be scripted to wiggle. (tanks, mechs etc)
I wonder because for features it makes no sense if their 3d model consists of multiple objects: they can not be animated anyway so everything might as well be combined into one object?
Well a static feature in spring from my understanding is a 3d object with supporting meta information in lua plus a couple of texture files.

I'm using alias wavefront obj format for the 3d files because it was the most documented and easiest to implement.

The meta information for an obj allows for object hierarchy, so I want to support what's possible.

longer term goals after I sort out a feature complete static feature exporter(i'm not there yet), is to work on animated features, perhaps particle effects like behe has demoed.. and then finally units.