ANN: OBJ model format support
Moderators: MR.D, Moderators
- Guessmyname
- Posts: 3301
- Joined: 28 Apr 2005, 21:07
Re: ANN: OBJ model format support
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?
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?
Re: ANN: OBJ model format support
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:
Anyway, please stop talking about I.K. See this topic to see why you should quit mentionning IK ever again.
Instead:
now this would be a possible and very awesome step forward.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?
Re: ANN: OBJ model format support
:)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.
- CarRepairer
- Cursed Zero-K Developer
- Posts: 3359
- Joined: 07 Nov 2007, 21:48
Re: ANN: OBJ model format support
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) 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.
Re: ANN: OBJ model format support
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.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.
2) Select the object that will be the child, then shift-select the object that will be parent, then press ctrl-P.
Re: ANN: OBJ model format support
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)zwzsg wrote:now this would be a possible and very awesome step forward.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?
- CarRepairer
- Cursed Zero-K Developer
- Posts: 3359
- Joined: 07 Nov 2007, 21:48
Re: ANN: OBJ model format support
Thank you very much!Hobo Joe wrote: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.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.
2) Select the object that will be the child, then shift-select the object that will be parent, then press ctrl-P.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: ANN: OBJ model format support
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... :-/
But still... :-/
- CarRepairer
- Cursed Zero-K Developer
- Posts: 3359
- Joined: 07 Nov 2007, 21:48
Re: ANN: OBJ model format support
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.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... :-/
So long UpSpring, you can join Scriptor in the recycle bin!
*Just exporting was not an option, these models used multiple materials and textures.
- Pressure Line
- Posts: 2283
- Joined: 21 May 2007, 02:09
Re: ANN: OBJ model format support
fyi argh, this already exixts.Argh wrote:Can we have a variant of this that will input OBJ data and output a display list? Please?
Re: ANN: OBJ model format support
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
Also, after a crash spring said it should be a driver problem, but that appeared once in fifty crashs
[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 )
Any ideas ?
Thx
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
Also, after a crash spring said it should be a driver problem, but that appeared once in fifty crashs
[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 )
Any ideas ?
Thx
- CarRepairer
- Cursed Zero-K Developer
- Posts: 3359
- Joined: 07 Nov 2007, 21:48
Re: ANN: OBJ model format support
I'm getting errors as well. I'm no expert pythonist but perhaps line 172 needs to be changed from
to
Changing this made it so the lua now generates, but I still get this error:
Code: Select all
log.Write("mid-pos distance of piece \"%s\": %.2f, {min, max}Y: %.2f, %.2f\n" % ((rr ** 0.5), minPieceY, maxPieceY))
Code: Select all
log.Write("mid-pos distance of piece \"%s\": %.2f, {min, max}Y: %.2f, %.2f\n" % (modelPieceName, (rr ** 0.5), minPieceY, maxPieceY))
Code: Select all
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
Re: ANN: OBJ model format support
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... :/
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... :/
- CarRepairer
- Cursed Zero-K Developer
- Posts: 3359
- Joined: 07 Nov 2007, 21:48
Re: ANN: OBJ model format support
Nooooooooooo thank you.Cremuss wrote:The .obj.lua are easy enough to be written by hand
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. SorryCremuss wrote:CarRepairer, did you try to write a basic .obj.lua by hand to see if importing a model is at least working ?
Re: ANN: OBJ model format support
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.
edit: done
Sorry about that, there are some bugs left in the OBJ loading code. I'll fix them before the RC goes live.Cremuss wrote:Spring crash instantly every time I click on the unitpic to build the unit (ingame)
edit: done
- Attachments
-
- uar_highpowerradar.png
- (2.04 MiB) Downloaded 2 times
Re: ANN: OBJ model format support
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
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
No problem, I'll wait for the next release (or at least the next fixes)Kloot wrote:Sorry about that, there are some bugs left in the OBJ loading code. I'll fix them before the RC goes live.
Hehe, goodluck with blenderCarRepairer 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
Re: ANN: OBJ model format support
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)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 ?
Re: ANN: OBJ model format support
Code: Select all
[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
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
Re: ANN: OBJ model format support
Thanks.
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).Cremuss wrote:My blender scene was made of 4 objects, with all their origins centered to 0,0,0.
Re: ANN: OBJ model format support
ah ok thanks. Height,radius and midpos works now.