Blender->Spring Feature script

Blender->Spring Feature script

Share and discuss visual creations and creation practices like texturing, modelling and musing on the meaning of life.

Moderators: MR.D, Moderators

User avatar
enetheru
Posts: 627
Joined: 11 Jun 2010, 07:32

Blender->Spring Feature script

Post 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.
Last edited by enetheru on 02 Aug 2013, 18:08, edited 1 time in total.
User avatar
enetheru
Posts: 627
Joined: 11 Jun 2010, 07:32

Re: Blender->Spring Feature script

Post 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
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Re: Blender->Spring Feature script

Post 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.
User avatar
enetheru
Posts: 627
Joined: 11 Jun 2010, 07:32

Re: Blender->Spring Feature script

Post 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
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Re: Blender->Spring Feature script

Post by rattle »

some insight by people who know better than I
User avatar
enetheru
Posts: 627
Joined: 11 Jun 2010, 07:32

Re: Blender->Spring Feature script

Post by enetheru »

rattle wrote:some insight by people who know better than I
insert relevant futurama fry meme
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: Blender->Spring Feature script

Post 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?
User avatar
enetheru
Posts: 627
Joined: 11 Jun 2010, 07:32

Re: Blender->Spring Feature script

Post 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.
User avatar
enetheru
Posts: 627
Joined: 11 Jun 2010, 07:32

Re: Blender->Spring Feature script

Post 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 46 times
User avatar
enetheru
Posts: 627
Joined: 11 Jun 2010, 07:32

Re: Blender->Spring Feature script

Post 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.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Blender->Spring Feature script

Post 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?
User avatar
enetheru
Posts: 627
Joined: 11 Jun 2010, 07:32

Re: Blender->Spring Feature script

Post 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.
User avatar
enetheru
Posts: 627
Joined: 11 Jun 2010, 07:32

Re: Blender->Spring Feature script

Post 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:
User avatar
enetheru
Posts: 627
Joined: 11 Jun 2010, 07:32

Re: Blender->Spring Feature script

Post 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..
User avatar
enetheru
Posts: 627
Joined: 11 Jun 2010, 07:32

Re: Blender->Spring Feature script

Post 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.
User avatar
enetheru
Posts: 627
Joined: 11 Jun 2010, 07:32

Re: Blender->Spring Feature script

Post 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.
wolas
Posts: 112
Joined: 30 Jul 2010, 20:40

Re: Blender->Spring Feature script

Post by wolas »

I imagine how hard is to newcomer to do something in spring since even old folks dont know whats already done :/
User avatar
enetheru
Posts: 627
Joined: 11 Jun 2010, 07:32

Re: Blender->Spring Feature script

Post 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 ;)
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Blender->Spring Feature script

Post 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?
User avatar
enetheru
Posts: 627
Joined: 11 Jun 2010, 07:32

Re: Blender->Spring Feature script

Post 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.
Post Reply

Return to “Art & Modelling”