ANN: OBJ model format support - Page 6

ANN: OBJ model format support

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

Moderators: MR.D, Moderators

User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: ANN: OBJ model format support

Post 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?
User avatar
Cremuss
Posts: 364
Joined: 28 Oct 2006, 21:38

Re: ANN: OBJ model format support

Post 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" :roll:

btw : do the .obj parser works with corpses ?
User avatar
Cremuss
Posts: 364
Joined: 28 Oct 2006, 21:38

Re: ANN: OBJ model format support

Post 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 ? :-)
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: ANN: OBJ model format support

Post 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.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: ANN: OBJ model format support

Post 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.
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: ANN: OBJ model format support

Post by CarRepairer »

Cremuss wrote:You just should name one of your real piece, "base" :roll:
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? :P

http://springrts.com/phpbb/viewtopic.ph ... 60#p444860

That's YOUR model! (with my edits.) It's using jK's normalmap gadget.
Last edited by CarRepairer on 21 Aug 2010, 19:51, edited 1 time in total.
Super Mario
Posts: 823
Joined: 21 Oct 2008, 02:54

Re: ANN: OBJ model format support

Post 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?
User avatar
Cremuss
Posts: 364
Joined: 28 Oct 2006, 21:38

Re: ANN: OBJ model format support

Post 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 :)
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: ANN: OBJ model format support

Post 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)
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: ANN: OBJ model format support

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

Image
Attachments
screen00014.jpg
(59.7 KiB) Downloaded 2 times
carpy.obj.txt
(1.4 MiB) Downloaded 33 times
carpy.lua
(1.81 KiB) Downloaded 119 times
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: ANN: OBJ model format support

Post by Kloot »

Sorry, rotated Blender objects are not (yet) handled correctly by the exporter.
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: ANN: OBJ model format support

Post 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. :-)
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: ANN: OBJ model format support

Post by CarRepairer »

*Bump*

Break's over. Kloot, you alive?
User avatar
thesleepless
Posts: 417
Joined: 24 Oct 2007, 04:49

Re: ANN: OBJ model format support

Post by thesleepless »

can't you apply the rotation to your objects before you export?

CTRL+A =)
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: ANN: OBJ model format support

Post 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.
User avatar
KingRaptor
Zero-K Developer
Posts: 838
Joined: 14 Mar 2007, 03:44

Re: ANN: OBJ model format support

Post by KingRaptor »

There's weird rendering behavior with cloaking .obj units.
For instance, this jammer tower from Cremuss' Final Outcome:
Image
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.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: ANN: OBJ model format support

Post 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.
User avatar
Rafal99
Posts: 162
Joined: 14 Jan 2006, 04:09

Re: ANN: OBJ model format support

Post 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?
Attachments
wp.obj.log
(5.1 KiB) Downloaded 23 times
wp.obj.lua
(439 Bytes) Downloaded 28 times
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: ANN: OBJ model format support

Post 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)
User avatar
Rafal99
Posts: 162
Joined: 14 Jan 2006, 04:09

Re: ANN: OBJ model format support

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

Return to “Art & Modelling”