View topic - ANN: OBJ model format support



All times are UTC + 1 hour


Post new topic Reply to topic  [ 121 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7  Next
Author Message
PostPosted: 02 Apr 2010, 13:22 
Modeler
User avatar

Joined: 28 Apr 2005, 20:07
Location: Next to the girl with kaleidascope eyes
Sorry, I thought you were saying that Lua animation was the be-all and end-all. Misunderstanding, in other words.

Though IK would probably be useful on giant walkers... and as memory serves, hasn't zwzsg and someone-else-from-TaUniverse-whose-name-I-forget already pulled that off?


Top
 Offline Profile  
 
PostPosted: 02 Apr 2010, 13:32 
Kernel Panic Co-Developer
User avatar

Joined: 16 Nov 2004, 13:08
Yes, me and Zodius, wrote some IK walkscripts. But they were taylored to specific units.

Anyway, please stop talking about I.K. See this topic to see why you should quit mentionning IK ever again.



Instead:
Guessmyname wrote:
Would it be that difficult to allow the use of a format with support for skeletal animations, whilst the script just uses bones instead of pieces? Ie the animation system (ie Turn, Move, Spin etc) would be exactly the same, but would allow for mesh deformation and proper animation of organic units. Still scripted animations rather than canned, but it would solve the worst of the issues with organic units. Would that be difficult?
now this would be a possible and very awesome step forward.


Top
 Offline Profile  
 
PostPosted: 02 Apr 2010, 14:41 
A.N.T.S. Developer
User avatar

Joined: 26 Sep 2009, 20:26
Location: Ukraine
zwzsg wrote:
Yes, me and Zodius, wrote some IK walkscripts. But they were taylored to specific units.

Anyway, please stop talking about I.K. See this topic to see why you should quit mentionning IK ever again.

:)


Top
 Offline Profile  
 
PostPosted: 05 Apr 2010, 17:30 
Cursed Zero-K Developer
User avatar

Joined: 07 Nov 2007, 21:48
Location: Horse
Maybe this should be split off to a new question in this forum but I cannot figure out these things in Blender despite looking long and hard on the web.

1) How do I move the origin of an object, but not the object itself?

2) How do I set up a hierarchy? For example, I have an object named A. I duplicate it and name the duplicate B. I want B to be a child of A. Kloot mentions setting up pieces as parents. How?

Thanks in advance.


Top
 Offline Profile  
 
PostPosted: 05 Apr 2010, 18:56 
Modeler
User avatar

Joined: 02 Jan 2008, 21:55
CarRepairer wrote:
Maybe this should be split off to a new question in this forum but I cannot figure out these things in Blender despite looking long and hard on the web.

1) How do I move the origin of an object, but not the object itself?

2) How do I set up a hierarchy? For example, I have an object named A. I duplicate it and name the duplicate B. I want B to be a child of A. Kloot mentions setting up pieces as parents. How?

Thanks in advance.


1) Put the cursor where you want the object center, then go to object > transform > center cursor. If you want to be precise with the location, use the cursor snapping tools in the shift-s menu.

2) Select the object that will be the child, then shift-select the object that will be parent, then press ctrl-P.


Top
 Offline Profile  
 
PostPosted: 05 Apr 2010, 23:35 
Moderator
User avatar

Joined: 29 Apr 2005, 00:14
Location: #moddev - join it!
zwzsg wrote:
Guessmyname wrote:
Would it be that difficult to allow the use of a format with support for skeletal animations, whilst the script just uses bones instead of pieces? Ie the animation system (ie Turn, Move, Spin etc) would be exactly the same, but would allow for mesh deformation and proper animation of organic units. Still scripted animations rather than canned, but it would solve the worst of the issues with organic units. Would that be difficult?
now this would be a possible and very awesome step forward.


Everyone seems to forget that Upspring can import BVH, which (if the BOS exporter were more robust) would give us everything you ask for, except mesh deformation - Not saying it would be a nice easy workflow, though (it'd be pretty horrendous i imagine)


Top
 Offline Profile  
 
PostPosted: 06 Apr 2010, 02:06 
Cursed Zero-K Developer
User avatar

Joined: 07 Nov 2007, 21:48
Location: Horse
Hobo Joe wrote:
CarRepairer wrote:
Maybe this should be split off to a new question in this forum but I cannot figure out these things in Blender despite looking long and hard on the web.

1) How do I move the origin of an object, but not the object itself?

2) How do I set up a hierarchy? For example, I have an object named A. I duplicate it and name the duplicate B. I want B to be a child of A. Kloot mentions setting up pieces as parents. How?

Thanks in advance.


1) Put the cursor where you want the object center, then go to object > transform > center cursor. If you want to be precise with the location, use the cursor snapping tools in the shift-s menu.

2) Select the object that will be the child, then shift-select the object that will be parent, then press ctrl-P.

Thank you very much!


Top
 Offline Profile  
 
PostPosted: 09 Apr 2010, 18:16 
Evolution RTS Developer
User avatar

Joined: 17 Nov 2005, 02:43
Location: Raegquitting Spring on 04/24/12
I'm not sure how I feel about having to use blender here. It has one of the most unfriendly interfaces I've seen (keep in mind, I'm not exactly in love with the wings interface), However I guess there isn't much choice considering that wings doesn't support origins.

But still... :-/


Top
 Offline Profile  
 
PostPosted: 09 Apr 2010, 22:12 
Cursed Zero-K Developer
User avatar

Joined: 07 Nov 2007, 21:48
Location: Horse
Forboding Angel wrote:
I'm not sure how I feel about having to use blender here. It has one of the most unfriendly interfaces I've seen (keep in mind, I'm not exactly in love with the wings interface), However I guess there isn't much choice considering that wings doesn't support origins.

But still... :-/

I felt exactly the same way. But when Cremuss released some awesome models in Blender format I had absolutely no choice but to dive in.* It's finally starting to grow on me.

So long UpSpring, you can join Scriptor in the recycle bin!


*Just exporting was not an option, these models used multiple materials and textures.


Top
 Offline Profile  
 
PostPosted: 09 May 2010, 07:49 
Battletech Developer
User avatar

Joined: 21 May 2007, 01:09
Location: New Zealand
Argh wrote:
Can we have a variant of this that will input OBJ data and output a display list? Please?


fyi argh, this already exixts.


Top
 Offline Profile  
 
PostPosted: 07 Aug 2010, 15:58 
Skinner / Texturer
User avatar

Joined: 28 Oct 2006, 20:38
Location: France
Hi.

I managed to import 1 piece only units into spring using obj's but if there is more than 1 pieces, spring crash :|

Spring crash log :
http://pastebin.com/z5i3dR1e

Obj.lua :
http://pastebin.com/1ENt5Hyd

Obj file contains both 'o abc' and "o def" lines.

ZIP : (contains textures 1&2, .obj and .obj.lua)
http://cremuss.free.fr/3d/2008/radarOBJtest.zip

Also, strange problem, it seems likes it works only with very simple name. I've this single piece geothermal station which works fine, but I first tried to put the only piece under "AdvGeoThermPWStation" name (in both .obj and .obj.lua files) and it didn't work. I then tried with very simple names like "abc" and it worked..

I checked the names 10 times and it wasn't an error between .obj and .obj.lua names :roll:

Also, after a crash spring said it should be a driver problem, but that appeared once in fifty crashs :shock:

[ebuild R ] x11-drivers/nvidia-drivers-195.36.24 USE="(multilib) -acpi -custom-cflags -gtk" 41,093 kB

spring 0.82.1, linux, nvidia 7600gt. I'm running the lowest settings possible (also tried the highest, but it didn't change anything :mrgreen: )

Any ideas ? :?
Thx


Top
 Offline Profile  
 
PostPosted: 08 Aug 2010, 02:43 
Cursed Zero-K Developer
User avatar

Joined: 07 Nov 2007, 21:48
Location: Horse
I'm getting errors as well. I'm no expert pythonist but perhaps line 172 needs to be changed from
Code:
log.Write("mid-pos distance of piece \"%s\": %.2f, {min, max}Y: %.2f, %.2f\n" % ((rr ** 0.5), minPieceY, maxPieceY))
to
Code:
log.Write("mid-pos distance of piece \"%s\": %.2f, {min, max}Y: %.2f, %.2f\n" % (modelPieceName, (rr ** 0.5), minPieceY, maxPieceY))

Changing this made it so the lua now generates, but I still get this error:
Code:
line 31, in Flush self.logFile.write(logBuff)
NameError: global name 'logBuff' is not defined
Exception NameError: "global name 'logBuff' is not defined" in <bound method SimpleLog.__del__ of <__main__.SimpleLog instance at 0x0400B080>> ignored


Top
 Offline Profile  
 
PostPosted: 08 Aug 2010, 03:01 
Skinner / Texturer
User avatar

Joined: 28 Oct 2006, 20:38
Location: France
In fact I don't even use the blender exporter script. The .obj.lua are easy enough to be written by hand (at least basic ones)
I tried the script in blender 2.49, though, and I couldn't get it working (same errors than CarRepairer, it was complaining about mid pos distance blabla)

Anyway I'm using blender 2.5 now so I guess the script needs to be ported on 2.5, I didn't try though.

CarRepairer, did you try to write a basic .obj.lua by hand to see if importing a model is at least working ?
Spring crash instantly every time I click on the unitpic to build the unit (ingame)

Upspring don't work anymore with wine 1.2 so .obj is the only way for me...
I could try downgrading wine but importing units in spring on linux shouldn't be that much tricky... :/


Top
 Offline Profile  
 
PostPosted: 08 Aug 2010, 05:21 
Cursed Zero-K Developer
User avatar

Joined: 07 Nov 2007, 21:48
Location: Horse
Cremuss wrote:
The .obj.lua are easy enough to be written by hand

Nooooooooooo thank you.

Cremuss wrote:
CarRepairer, did you try to write a basic .obj.lua by hand to see if importing a model is at least working ?

Actually I haven't even loaded up the RC Spring, I am just trying to learn some more blender and be ready when it's out. Sorry :(


Top
 Offline Profile  
 
PostPosted: 08 Aug 2010, 10:45 
Spring Developer

Joined: 08 Oct 2006, 15:58
Thanks for spotting those typos in the exporter script, I've attached a new version at the top of this thread. As for getting it to work in Blender 2.5, the scripting API changes since 2.4 are probably going to mean a rewrite.

Cremuss wrote:
Spring crash instantly every time I click on the unitpic to build the unit (ingame)


Sorry about that, there are some bugs left in the OBJ loading code. I'll fix them before the RC goes live.

edit: done ;)

Image


Attachments:
uar_highpowerradar.png [2.04 MiB]
Downloaded 2 times
Top
 Offline Profile  
 
PostPosted: 08 Aug 2010, 14:32 
Skinner / Texturer
User avatar

Joined: 28 Oct 2006, 20:38
Location: France
Thank you Kloot :-)

The new exporter scripts is working in blender, everything is good expect that radius, height, and midpos are all 0. Did I do something wrong or is your script not suppose to write them ?

Also, it seems that the script exports everything in the scene (in blender). It could be cool to export only selected objects :-)

Kloot wrote:
Sorry about that, there are some bugs left in the OBJ loading code. I'll fix them before the RC goes live.


No problem, I'll wait for the next release (or at least the next fixes) 8)

CarRepairer wrote:
Actually I haven't even loaded up the RC Spring, I am just trying to learn some more blender and be ready when it's out. Sorry

Hehe, goodluck with blender :mrgreen:


Top
 Offline Profile  
 
PostPosted: 08 Aug 2010, 15:22 
Spring Developer

Joined: 08 Oct 2006, 15:58
Cremuss wrote:
The new exporter scripts is working in blender, everything is good expect that radius, height, and midpos are all 0. Did I do something wrong or is your script not suppose to write them ?


No, those should definitely be filled in automatically. May I see the script's export log for uar_highpowerradar.obj? (it should just be called uar_highpowerradar.log and saved alongside the .lua metadata)


Top
 Offline Profile  
 
PostPosted: 08 Aug 2010, 16:29 
Skinner / Texturer
User avatar

Joined: 28 Oct 2006, 20:38
Location: France
Code:
[SpringOBJMetaDataScriptExporter] export log for model "uar_highpowerradar"

processed object "base" with offsets {0.00, 0.00, 0.00} (has parent: true)
processed object "cylinder" with offsets {0.00, 0.00, 0.00} (has parent: false)
processed object "turret" with offsets {0.00, 0.00, 0.00} (has parent: false)
processed object "radars" with offsets {0.00, 0.00, 0.00} (has parent: false)
model has 4 pieces (has root-piece: true)
model-piece "turret" is a child of "base" (parent has 1 children)
model-piece "radars" is a child of "base" (parent has 2 children)
model-piece "cylinder" is a child of "base" (parent has 3 children)
model mid-position: <0.00, 0.00, 0.00>
mid-pos distance of piece "turret": 0.00, {min, max}Y: 0.00, 0.00
mid-pos distance of piece "radars": 0.00, {min, max}Y: 0.00, 0.00
mid-pos distance of piece "cylinder": 0.00, {min, max}Y: 0.00, 0.00
mid-pos distance of piece "base": 0.00, {min, max}Y: 0.00, 0.00


My blender scene was made of 4 objects, with all their origins centered to 0,0,0.
One object called "base" with three childrens parented to it : "radars", "cylinder", "turret".
No scales, no rotations, no modifiers, nothing.
I can give you the blender file if you want.

.lua metadata
http://pastebin.com/WQ28dN3T


Top
 Offline Profile  
 
PostPosted: 08 Aug 2010, 18:08 
Spring Developer

Joined: 08 Oct 2006, 15:58
Thanks.

Cremuss wrote:
My blender scene was made of 4 objects, with all their origins centered to 0,0,0.


Do you mean all objects were at <0,0,0> in the same global space, but with offset vertices to prevent overlapping geometry? If so, that won't work; the script expects that each child object as a whole is translated with respect to its parent (for the calculation of radius and height, it doesn't actually look at vertex positions).


Top
 Offline Profile  
 
PostPosted: 08 Aug 2010, 19:16 
Skinner / Texturer
User avatar

Joined: 28 Oct 2006, 20:38
Location: France
ah ok thanks. Height,radius and midpos works now.


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 121 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.