Page 6 of 7
Re: ANN: OBJ model format support
Posted: 20 Aug 2010, 20:22
by CarRepairer
CarRepairer wrote:I do have an empty base piece and I use it in every model for spring. But the blender obj exporter decides to discard it? Blender experts, any help?
So what can be done about this? jK informed me that an empty root piece is very bad mojo. Leaf pieces are alright, and I use those for aiming and effects purposes. Should I create tiny microscopic tetrahedrons?
Re: ANN: OBJ model format support
Posted: 20 Aug 2010, 22:55
by Cremuss
CarRepairer wrote:CarRepairer wrote:I do have an empty base piece and I use it in every model for spring. But the blender obj exporter decides to discard it? Blender experts, any help?
So what can be done about this? jK informed me that an empty root piece is very bad mojo. Leaf pieces are alright, and I use those for aiming and effects purposes. Should I create tiny microscopic tetrahedrons?
You just should name one of your real piece, "base"
btw : do the .obj parser works with corpses ?
Re: ANN: OBJ model format support
Posted: 21 Aug 2010, 14:39
by Cremuss
double post, sry.
Anyone has tried to apply normal maps to .obj units ?
Kloot/Argh's shader works very basicly but it has a lot of glitchs and the fps drops to 1 when the unit is being built.
CA's/S44 imporved shader seems to be .s3o specific. I tried to add my units directly in CA, I can see normals maps on other units but not on mine (adding/removing the customparam changes nothing). I also tried to pick S44 gadget but it does not work either. Any ideas ?

Re: ANN: OBJ model format support
Posted: 21 Aug 2010, 16:40
by Kloot
CarRepairer wrote:Current version or next version?
Current (82.3), assuming there were only Unix-style line endings in your model. If that was already the case and it still crashed, I'd have to see the .obj.
Super Mario wrote:Importer script for blender would be better for me.
So make one?
Cremuss wrote:btw : do the .obj parser works with corpses ?
Yep, features can have OBJ models too.
Cremuss wrote:
Kloot/Argh's shader works very basicly but it has a lot of glitchs and the fps drops to 1 when the unit is being built.
I don't know what kinds of hacks Argh applied to the code, but I can provide my original gadget if you want.
Cremuss wrote:
CA's/S44 imporved shader seems to be .s3o specific. I tried to add my units directly in CA, I can see normals maps on other units but not on mine (adding/removing the customparam changes nothing). I also tried to pick S44 gadget but it does not work either. Any ideas ?
You need at least CA revision 8267.
Re: ANN: OBJ model format support
Posted: 21 Aug 2010, 19:09
by jK
Kloot wrote:Cremuss wrote:
Kloot/Argh's shader works very basicly but it has a lot of glitchs and the fps drops to 1 when the unit is being built.
I don't know what kinds of hacks Argh applied to the code, but I can provide my original gadget if you want.
The problem is that units in build are rendered with an user clipplane. Many GPUs don't support this in combination with shaders and fallback to software rendering. My gadget disables custom shaders for units in built for that reason.
Re: ANN: OBJ model format support
Posted: 21 Aug 2010, 19:47
by CarRepairer
Cremuss wrote:You just should name one of your real piece, "base"
I did that. But I still need empty leaf pieces. For example an empty piece at the tip of the sword where I want a flame effect.
Cremuss wrote:Anyone has tried to apply normal maps to .obj units ?
Did you not see the post?
http://springrts.com/phpbb/viewtopic.ph ... 60#p444860
That's YOUR model! (with my edits.) It's using jK's normalmap gadget.
Re: ANN: OBJ model format support
Posted: 21 Aug 2010, 19:51
by Super Mario
Kloot wrote:
Super Mario wrote:Importer script for blender would be better for me.
So make one?
You think that I know how?
Re: ANN: OBJ model format support
Posted: 22 Aug 2010, 02:54
by Cremuss
CarRepairer helped me, I thought the customParam with the CA's gadget was the same than the one in Argh's/Kloot example, so problem fixed now thx all :)
Re: ANN: OBJ model format support
Posted: 27 Aug 2010, 02:39
by FLOZi
Cremuss wrote:CarRepairer helped me, I thought the customParam with the CA's gadget was the same than the one in Argh's/Kloot example, so problem fixed now thx all :)
fwiw, S44 version of jk's gadget now supports OBJ too (and is hopefully easier to extricate from the mod)
Re: ANN: OBJ model format support
Posted: 29 Aug 2010, 00:20
by CarRepairer
Help, my models are falling apart again.
Even though we finally had success on my previous and first model, now my second model is falling apart when rotating its parts and I have no idea why.
I set up the origins, I exported the obj and lua and everything looks right. I have to set globalvertexoffsets = true for the pieces to start out correctly (same as in the first model) but the animations are not correct in this model. The pieces are not rotating about their origins as set up in the blender file.
I also tried changing line 103 as instructed
here but that actually makes things worse.
I tried apply scale/rotation to data and some other stuff in that menu but it doesn't help.

Re: ANN: OBJ model format support
Posted: 29 Aug 2010, 13:07
by Kloot
Sorry, rotated Blender objects are not (yet) handled correctly by the exporter.
Re: ANN: OBJ model format support
Posted: 29 Aug 2010, 17:12
by CarRepairer
Kloot wrote:Sorry, rotated Blender objects are not (yet) handled correctly by the exporter.
Man, that sucks but now I'm relieved to at least know the reason. I need a break from blender anyway.

Re: ANN: OBJ model format support
Posted: 26 Nov 2010, 03:09
by CarRepairer
*Bump*
Break's over. Kloot, you alive?
Re: ANN: OBJ model format support
Posted: 26 Nov 2010, 06:52
by thesleepless
can't you apply the rotation to your objects before you export?
CTRL+A =)
Re: ANN: OBJ model format support
Posted: 29 Nov 2010, 17:27
by CarRepairer
thesleepless wrote:can't you apply the rotation to your objects before you export?
CTRL+A =)
CarRepairer wrote:I tried apply scale/rotation to data and some other stuff in that menu but it doesn't help.
I already do that (
for other reasons - fixing normals) but it doesn't fix this problem. I need Kloot's smarts to update his exporter script to work for rotation the same way he
fixed it to work with scales.
Re: ANN: OBJ model format support
Posted: 11 Dec 2010, 04:01
by KingRaptor
There's weird rendering behavior with cloaking .obj units.
For instance, this jammer tower from Cremuss' Final Outcome:

This happens when the jammer tower in ZK (r871 and up) cloaks or decloaks (Lups effect); the texture returns to normal once the effect ends.
When rendered partially transparent without the Lups effect (in the original game, or when selecting a build spot for it in any game), the model is a uniform teal color instead of the expected texture + teamcolor.
Re: ANN: OBJ model format support
Posted: 11 Dec 2010, 16:29
by Kloot
KingRaptor wrote:This happens when the jammer tower in ZK (r871 and up) cloaks or decloaks (Lups effect); the texture returns to normal once the effect ends.
LUPS bug in lups/ParticleClasses/UnitCloaker.lua, OBJ models are seen as 3DO's:
Code: Select all
function UnitCloaker:CreateParticle()
self.isS3o = (UnitDefs[self.unitDefID].model.name:lower():find("s3o") and true)
...
end
(there is an identical line in lups/ParticleClasses/UnitJitter.lua)
KingRaptor wrote:When rendered partially transparent without the Lups effect (in the original game, or when selecting a build spot for it in any game), the model is a uniform teal color instead of the expected texture + teamcolor.
Engine bug, fixed.
Re: ANN: OBJ model format support
Posted: 10 Feb 2011, 10:15
by Rafal99
I need some help.
I got Blender 2.49b, s3o importer script, and obj metadata exporter from this thread.
Now I run Blender, import s3o that I made - it loads, model looks fine.
Then I export obj metadata and select a file name.
It creates 2 files: wp.obj.lua and wp.obj.log
But the lua file created is almost empty, it only contains numpieces + some default variables. Doesn't contain any piece hierarchy or translations at all!
What is stranger is that the log file says there were pieces processed and it even prints their offsets. Which means the s3o was correctly loaded and data was here.
Any idea what is wrong?
Re: ANN: OBJ model format support
Posted: 10 Feb 2011, 12:25
by Kloot
The export fails because your model contains multiple meta-pieces ("SpringRadius", "SpringHeight", "Cube") without a parent. Any such piece (more specifically, the first encountered) is assumed to be the root object, so there must be exactly one.
("SpringRadius" and "SpringHeight" are added by the S3O importer, you'll have to remove or re-link them before exporting)
Re: ANN: OBJ model format support
Posted: 10 Feb 2011, 22:00
by Rafal99
Yeah it was that, thanks for help!
When I removed (after many tries) the extra pieces it exported a correct lua file. The "Cube" was there because Blender starts new scene with a cube in it. I thought import would overwrite scene geometry but instead the cube became hidden inside my model...
I must have gotten some unfortunate version of Blender - the outline doesn't work 80% of the time, and object deleting removes it from the object list without really deleting it...