New PoserTools release

What it says on the tin: a place to discuss proposed new features.
User avatar
marco.c
Halfling
Posts: 51
Joined: Mon Nov 22, 2004 5:44 pm
Location: Italy

New PoserTools release

Post by marco.c »

Hi there,

I updated the PoserTools (a Poser figure exporter by KayNine) to compile with VC++ 7.1 and Ogre 1.0.0. I managed to export a Poser 5 figure. There is still some problem with complex meshes and at the moment it doesn't export animations.
It compiles and works fine. Does anybody want to try it?
KayNine
Halfling
Posts: 71
Joined: Wed Dec 03, 2003 10:53 am
Location: Adelaide, Australia

Post by KayNine »

Thanks for doing this Macro.
User avatar
marco.c
Halfling
Posts: 51
Joined: Mon Nov 22, 2004 5:44 pm
Location: Italy

Post by marco.c »

Thanks to you.

I have a couple of questions for you about PoserTools.
I extended it with a new feature. Now it can export animated meshes, but it's quite awkward (I get motion data from an outer file, not the PZ3).
I am wondering what actually happens in the PoserManager object. In fact, when I load my animated mesh in the MeshViewer tool, it shows the figure moving. When I do it from the PoserSceneViewer, the figure doesn't move. I believe there must be a point where the PoserManager tells Ogre that the mesh loaded isn't animated, so Ogre goes on ignoring the animation.

Then, I tried to modify the PoserSceneViewer. I loaded the mesh from the default SceneManager (and linked the figure to a SceneNode), but nothing appears on the screen. It's just black. I'm not sure if it's just my video card that isn't powerful enough, or maybe I'm missing something.
I had a look to your PoserTools sources, but I haven't find an answer yet.

Thanks in advance,
M.
KayNine
Halfling
Posts: 71
Joined: Wed Dec 03, 2003 10:53 am
Location: Adelaide, Australia

Post by KayNine »

Marco....

My original ideas for animation were to take the key {} commands out of the pz3 file. There is already code in OgrePoserPz3File.cpp to read the keys section (PoserPz3Channel::_readKeys()), so all the animation date should be contained in the PoserPz3Channel variables for each actor.

From memory, PoserSceneViewer doesn't have the code in it to handle animations. Check the AnimatedRobot sample to see the code required for animation - then modify PoserSceneViewer accordingly. But you'll need to write some code to setup the Ogre animation keys according to the keys read from the pz3 file.

Sorry I can't be more help - it's been a long time since I wrote all this code.
User avatar
marco.c
Halfling
Posts: 51
Joined: Mon Nov 22, 2004 5:44 pm
Location: Italy

Post by marco.c »

I extended your tool, it now exports a model and sets up multiple animations.
It's not very handy, because you need to specify in the command line which .bvh files you want to add (as animations) in your model, but it works. Reading the keys from the pz3 file turned out to be difficult...

Once the model is exported, it's complete, you can even see it moving with the MeshViewer tool, but unfortunately, in PoserSceneViewer it doesn't. What I'm investigating now is why PoserSceneViewer doesn't deal with animations, even though I added all the code from the Animated Robot sample. The figure seems not to have the binding pose set. Or there may be something that prevents the animation from going on. I'll check the PoserManager class.

If you have any hint, I'll be eternally grateful :)
Don't worry if you feel rusty with the code, you have helped me a lot so far :)

Thanks,
M
User avatar
hebdemnobad
Goblin
Posts: 274
Joined: Wed Feb 09, 2005 5:09 pm
Location: catskill escarpment, new york, usa
x 3

Post by hebdemnobad »

very cool! many ex-viewpoint developers who once used a poser to viewpoint workflow are now looking for a poser to ogre worklow. keep up the good work! :D
User avatar
marco.c
Halfling
Posts: 51
Joined: Mon Nov 22, 2004 5:44 pm
Location: Italy

Post by marco.c »

Glad to hear that.

Actually there's only one problem, and may be someone can help me. I'm in trouble writing the animation xml tags. It seems that there's no BVH RFC or detailed reference.
I don't know how to handle the BVH motion data, so I'm trying to figure out how to write it in a .skeleton.xml file (inside the animations tag).

What I really need are suggestions on how to transform the figures from .bvh to .skeleton.xml. At the moment, the animations work, but they appear very bad
:shock:
I'm working to fix it, but alone is more difficult (and less entertaining).

If anyone wanted to help me, I'd be eternally grateful to them :roll:
Even links or tutorials would be appreciated.
Thanks,
M
User avatar
marco.c
Halfling
Posts: 51
Joined: Mon Nov 22, 2004 5:44 pm
Location: Italy

Post by marco.c »

Fixed!

Just for the sake of it, and for those still watching this thread :)
I finally managed to add animations from a bvh file to a skeleton.
The result is a great deal better now.

M
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67

Post by sinbad »

Good to hear :) Will you be sharing your code with the community? I've never used BVH myself, and I think many people might import it into their modellers rather than convert it direct, but these things tend to end up being useful to people anyway.
User avatar
hebdemnobad
Goblin
Posts: 274
Joined: Wed Feb 09, 2005 5:09 pm
Location: catskill escarpment, new york, usa
x 3

Post by hebdemnobad »

marco is there any way to make a compiled version of your converter...just a command line tool would be fine. there are many atmosphere developers migrating to blink 3d(www.pelicancrossing.com) , which implements ogre in web pages. the poser to atmosophere workflow was one which many of us used. getting poser to ogre conversions would be kickass (as we say here in nyc) :D i have dozens of poser characters that have no where to go now becuase there is no way to get the skeletons and animations into ogre. it sounds like you're doing great work :D
User avatar
marco.c
Halfling
Posts: 51
Joined: Mon Nov 22, 2004 5:44 pm
Location: Italy

Post by marco.c »

Of course, I'd like to share my code with the community.
It might need some improvements.
At the moment it's a mixture of C and C++, but I'm going to encapsulate all the C code in a C++ class.

To hebdemnobad: kick-ass. Sounds good :)
Actually I didn't develop a mesh converter. I just added some new features to the PoserTools, then I updated it on Ogre 1.0.X and VC7.1.
I could make a .exe just to show how it works.
I'm going to publish it on my web page and I'll put the link in this thread as soon as possible, as well as a link to the sources, for those who want them. Ok?

M
User avatar
marco.c
Halfling
Posts: 51
Joined: Mon Nov 22, 2004 5:44 pm
Location: Italy

Post by marco.c »

Here you are!

Here you find two links to the binary command line tool.
.ace is compressed with WinAce, otherwise you can download the uncompressed version.

http://utenti.lycos.it/mcarosio/pt011/P ... ractor.ace (50Kb)
http://utenti.lycos.it/mcarosio/pt011/P ... ractor.exe (148kb)

Save the link as... to download it

Usage:
PoserMeshExtractor <PoserDir> <OgreMediaDir> <file.pz3> [animation list...] [slowdown]

PoserDir is the dir where Poser is installed. On my machine it is C:\Program Files\Curious Labs\Poser 5

OgreMediaDir is the path to the Media dir in ogrenew\Samples

file.pz3 is the figure you want to export.

Then, a optional list of animations may follow. Just write a list of file names like jump.bvh kick.bvh and so on.

At the end, you can put an optional slowdown (or speedup if less than 1) factor, if you want the animations slower. Put 1 or ignore it if you want them played at the normal speed.

Play the aniamtions with MeshViewer. It might be a bit dull, but it works. Also, MeshViewer loops automatically the animation. Unfortunately, it applies the binding pose every time, so you might see your figure making some extra move :)

Remember, the bvh hierarchy of bones must match your figure's skeleton.
I'm still working on a tool to convert bvh hierarchies to match a particular skeleton.

Enjoy!
M
User avatar
marco.c
Halfling
Posts: 51
Joined: Mon Nov 22, 2004 5:44 pm
Location: Italy

Post by marco.c »

And here is the code.

PoserMeshExtractor is the main application.
AnimationHandler loads the animations. Its interface consists of several methods.
writeAnimation(int,TiXmlElement*)
writes a specific animation in the .skeleton.xml file. Look
PoserMeshExtractor at line 578.

writeAllAnimations(TiXmlElement*)
writes all the animations in the .skeleton.xml file.

createAnimation(int,Entity*)
creates the animation on-the-fly. Actually, I haven't
tested this feature.

Here is the link to dowload the source code:
http://utenti.lycos.it/mcarosio/pt011/bvhsrc.tgz (37 kb)
User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post by :wumpus: »

Your source code seems to lack "OgrePoserManager.h" and a few other files, could you please provide those as well?
(and the solution/makefile maybe)
User avatar
hebdemnobad
Goblin
Posts: 274
Joined: Wed Feb 09, 2005 5:09 pm
Location: catskill escarpment, new york, usa
x 3

Post by hebdemnobad »

wow marco i can't wait to try it out :D :D

would you be able to post the group of command line msdos commands involved in converting a mesh with some bvh animations? i'm something of an msdos infant and i may be speaking for more than a few of my fellow ex-atmo developers....

again, wonderful news! i've been funneling my animations through milkshape, which works, but isn't as advanced in terms of vertex weights and blend zones as poser is.
User avatar
marco.c
Halfling
Posts: 51
Joined: Mon Nov 22, 2004 5:44 pm
Location: Italy

Post by marco.c »

Ok!

All that you need to do is:

1) extract the mesh & skeleton files
The command is PoserMeshExtractor <PoserDir> <OgreMediaDir> <file.pz3> [animation list...] [slowdown]
You can find more details in this thread, more or less 4 posts above.
Example: you may want to convert the figure Judy.pz3
So you write:
PoserMeshExtractor "C:\Program Files\curious Labs\Poser 5" E:\Ogre\ogre1-0-0\ogrenew\Samples\Media Judy.pz3 walk.bvh run.bvh 2.5

You have Judy.mesh.xml and Judy.skeleton.xml extracted in your Media dir. The figure now has got two animations, called walk and run (just the file name without the extention), slowed down 2.5 times (you may want them slower). Omitting this figure, cause the animation to be played at the original pace.

2) Convert the .xml files with OgreXMLConverter as usual.
OgreXMLConverter ..\..\..\Media\Judy.skeleton.xml
OgreXMLConverter ..\..\..\Media\Judy.mesh.xml

3) Move your .mesh and .skeleton files in a suitable place (I use Madia\models)

That's all I think. Make sure that PoserMeshExtractor.exe is in Samples\Common\bin\Release (or Debug). It should be copied automatically when VC7 compiles it. I added a post-build rule.

BTW, I found a little error in the code submitted before.
It seems that the rotation order is not respected for all the bones. I'm going to fix it, replace the links on my webpage and notify the forum.

Any feedback is welcome :)

PS: I won't be around till wednesday morning.
User avatar
marco.c
Halfling
Posts: 51
Joined: Mon Nov 22, 2004 5:44 pm
Location: Italy

Post by marco.c »

Sorry :wumpus:, I really didn't see your post.
I'm going to publish an updated version of the sw as soon as possible.

M
User avatar
marco.c
Halfling
Posts: 51
Joined: Mon Nov 22, 2004 5:44 pm
Location: Italy

Post by marco.c »

Here is the updated version

http://utenti.lycos.it/mcarosio/pt013/P ... V00-13.zip
http://utenti.lycos.it/mcarosio/pt013/P ... V00-13.ace

It contains the VC7.1 solution to build the Exporter. You will also find the scene viewer. Unfortunately, I had to remove some lines because they belong to my university, and I can't redistribute them. Don't worry, they were intended to do some extra work, which doesn't have anything to do with Ogre.
Anyway, both the exporter and the viewer compiles (I tried them).

PS for Christian Burisch:
Yes, you can scale the mesh or the animation.
If you do it with Poser, you just have to select the right scale factor.
Otherwise, if you create an BVH animation, and you export it without automatic scaling, the file includes also information to scale the mesh.
For instance, you may want your figure to grow up.
At the moment, the exporter can cope with both the automatic scaled and the normal format.
If you read BVH docs, you will find that BVH doesn't deal with scaling factors. Actually, it's not true, it depends on how you generate the hierarchy. There's no standard format.

The glitches you see with the animation is due to the fact that, when Ogre runs an animation, it sets the figure to the binding pose, then plays the animation. When it finishes, the da Vinci pose is applied again. Then, it loops the animation again. I think it depends on the way Ogre handles the animations.
User avatar
marco.c
Halfling
Posts: 51
Joined: Mon Nov 22, 2004 5:44 pm
Location: Italy

Post by marco.c »

Here you find two more links to the updated sources.

http://utenti.lycos.it/mcarosio/pt014/O ... V00-14.zip (110Kb)
http://utenti.lycos.it/mcarosio/pt014/O ... V00-14.ace (84Kb)

I fixed a few bugs in the exporter and prepared a viewer, which I hope you will find useful.
The PoserMeshExtractor hasn't changed at all.
You will find the PoserSceneViewer as well. To run the viewer, just type:

PoserSceneViewer <meshname> <meshfile.mesh>

and you will see your figure. Press space and it plays the animations. To select which animations you want to be played, place an ASCII file (name = animseq.seq) in the dir where you run PoserSceneViewer, and write the sequence of animation names in it. You need to use the animseq.seq name, at the moment you can't change it at runtime. Otherwise, you can modify the sources.

Remember, the mesh file has to be placed in the Media dir.
User avatar
Mr.Bloodworth
Halfling
Posts: 91
Joined: Fri Mar 25, 2005 3:19 am

Post by Mr.Bloodworth »

In english, what does this do?

Does it take the natave poser file and create the .mesh and .skeltion files with animation intact for use in orge?

Is this a plugin for poser?

Does it have a UI? or is this a command line tool? (would be best if this was a plugin or had a UI).

Will you be posting a compiled Exe for all us non-programer types?

Neet!
Satria
Kobold
Posts: 35
Joined: Wed Jun 01, 2005 6:36 am

Post by Satria »

Hi, I got problem with Poser 6.pz3 files
Please help me with the solutions

Thanks,
Satria

Code: Select all

Command Line:
J:\ogrenew\Samples\Common\bin\Release>PoserMeshExtractor.exe "J:\ogrenew\Samples\Common\bin\Release\James.Poser.6\Poser 6" "J:\ogrenew\Samples\Media" JameswithHair.pz3

Unknown token on Poser.6.pz3.file:
#1 PoserPz3File::PoserPz3File | Unknown token <controlProp>. 
#2 PoserPz3File::PoserPz3File | Unknown token <morphBinaryFile>. 
#3 PoserPz3Actor::ReadMainSection | Unknown token <useZBuffer>. 
#4 PoserPz3Actor::ReadMainSection | Unknown token <creaseAngle>. 
#5 PoserPz3Actor::ReadMainSection | Unknown token <shadowRaytraceSoftness>.
#6 PoserPz3File::PoserPz3File | Unknown token <FocusDistanceControl>. 
#7 
#8 PoserPz3File::PoserPz3File | Unknown token <figureHair>.
#9 Unable to lookup obj files from compressed version [.??z] such as: pzz (of pz3), obz (of obj)
#10 
#11 PoserPz3Actor::ReadMainSection Unknown token <useZBuffer>.
#12 PoserPz3Actor::ReadMainSection Unknown token <creaseAngle>.
#13 PoserPz3File::PoserPz3File Unknown token <name>.
#14 PoserPz3File::PoserPz3File Unknown token <bend>.
#15 PoserPz3File::PoserPz3File Unknown token <dynamicsLock>.
#16 PoserPz3File::PoserPz3File Unknown token <hidden>.
#17 PoserPz3File::PoserPz3File Unknown token <addToMenu>.
#18 PoserPz3File::PoserPz3File Unknown token <castsShadow>.
#19 PoserPz3File::PoserPz3File Unknown token <includeInDepthCue>.
#20 PoserPz3File::PoserPz3File Unknown token <useZBuffer>.
#21 PoserPz3File::PoserPz3File Unknown token <parent>.
#22 PoserPz3File::PoserPz3File Unknown token <MAIN_CAMERA>.
#23 PoserPz3File::PoserPz3File Unknown token <creaseAngle>.
#24 PoserPz3File::PoserPz3File Unknown token <channels>.
#25 PoserPz3File::PoserPz3File Unknown token <rotateY>.
#26 PoserPz3File::PoserPz3File Unknown token <yRotate>.
#27 PoserPz3File::PoserPz3File Unknown token <yrot>.
#28 PoserPz3File::PoserPz3File Unknown token <initValue>.
#29 PoserPz3File::PoserPz3File Unknown token <hidden>.
#30 PoserPz3File::PoserPz3File Unknown token <forceLimits>.
#31 PoserPz3File::PoserPz3File Unknown token <min>.
#32 PoserPz3File::PoserPz3File Unknown token <max>.
#33 PoserPz3File::PoserPz3File Unknown token <trackingScale>.
#34 PoserPz3File::PoserPz3File Unknown token <keys>.
#35 PoserPz3File::PoserPz3File Unknown token <static>.
#36 PoserPz3Channel::ReadChannel Unknown token <focusDistance>.
#37 PoserPz3Channel::ReadChannel Unknown token <fStop>.
#38 PoserPz3Channel::ReadChannel Unknown token <ShutterOpen>.
#39 PoserPz3Channel::ReadChannel Unknown token <ShutterClose>.
#40 PoserPz3Channel::ReadChannel Unknown token <yon>.
#xx alot more inside <controlProp>

Here some of the files i put inside of James.Poser.6.zip:
J:\ogrenew\Samples\Common\bin\Release\James.Poser.6\JameswithHairScrshot.jpg [ScreenShot of the James in Poser 6]
J:\ogrenew\Samples\Common\bin\Release\James.Poser.6\JameswithHair.pz3
J:\ogrenew\Samples\Common\bin\Release\James.Poser.6\PoserTools.Bugs.txt
J:\ogrenew\Samples\Common\bin\Release\James.Poser.6\Poser 6\Runtime\Geometries\Camera\Camera.obz [rename to Camera.obz.zip to extract]
J:\ogrenew\Samples\Common\bin\Release\James.Poser.6\Poser 6\Runtime\libraries\Character\James\JamesCasual.obz [same as above]
J:\ogrenew\Samples\Common\bin\Release\James.Poser.6\Poser 6\Runtime\libraries\Character\James\JamesCasual.pmd
Download James.Poser.6.zip here
User avatar
marco.c
Halfling
Posts: 51
Joined: Mon Nov 22, 2004 5:44 pm
Location: Italy

Post by marco.c »

To Mr.Bloodworth:
Do you mean PoserMeshExtractor or PoserSceneViewer?
They are both part of the PoserTools, a Poser to Ogre exporter.
PoserMeshExtractor takes a Poser 5 file and writes the intermediate XML files. Then, you need to convert it to the binary format, which Ogre actually uses, using the XMLConverter tool.
It isn't a plugin for Poser, it's just a stand alone application.
I haven't developed a GUI for PoserTools, you have to run it as a command line tool.
I might develop both a Python script which runs the exporter or a GUI for it, but now I'm really snowed under with work.
I will submit a link to the compiled exe as soon as possible.
I posted some notes on its usage, you will find them in this thread.

Cheers,
M

To: Satria
PoserTools doesn't handle Poser 6 files. I updated it to version 5, but I believe it won't be difficult updating it to Poser 6. All you need to do is adding the tokens it complains about where PoserTools parses the Poser file. There is a chain of if-elses where the exporter decides what to do with each token. Look for the keyword "morphPutty", and you will find the piece of code I mean. If you have any problems, I can do it for you.

The problem is the semantic of those tokens. You have to decide how to handle them. Unfortunately, I can't help you with it, I don't know the Poser 6 file format, neither I have Poser 6 installed. Anyway, you can always ignore the tokens. Use the _ignoreBlock method as I did, to avoid the problem.

Best,
M
Satria
Kobold
Posts: 35
Joined: Wed Jun 01, 2005 6:36 am

Post by Satria »

@marco.c: Download James.Poser.6.zip here
It the pz3 files, the obz files and other runtime files,

skipping the code is no problem, but the result its weird... :(
User avatar
marco.c
Halfling
Posts: 51
Joined: Mon Nov 22, 2004 5:44 pm
Location: Italy

Post by marco.c »

I downloaded your file, but now I can't open it. I don't have Poser 6. I may try to export it anyway, and to add the tokens to the exporter, but I may take some time. I'm pretty busy now, but I can do that.
The weird appearance of your figure is due to the skipped tokens. They may represent something crucial.

M
User avatar
Mr.Bloodworth
Halfling
Posts: 91
Joined: Fri Mar 25, 2005 3:19 am

Post by Mr.Bloodworth »

marco.c wrote:To Mr.Bloodworth:
Do you mean PoserMeshExtractor or PoserSceneViewer?
They are both part of the PoserTools, a Poser to Ogre exporter.
PoserMeshExtractor takes a Poser 5 file and writes the intermediate XML files. Then, you need to convert it to the binary format, which Ogre actually uses, using the XMLConverter tool.
It isn't a plugin for Poser, it's just a stand alone application.
I haven't developed a GUI for PoserTools, you have to run it as a command line tool.
I might develop both a Python script which runs the exporter or a GUI for it, but now I'm really snowed under with work.
I will submit a link to the compiled exe as soon as possible.
I posted some notes on its usage, you will find them in this thread.

Cheers,
M

To: Satria
PoserTools doesn't handle Poser 6 files. I updated it to version 5, but I believe it won't be difficult updating it to Poser 6. All you need to do is adding the tokens it complains about where PoserTools parses the Poser file. There is a chain of if-elses where the exporter decides what to do with each token. Look for the keyword "morphPutty", and you will find the piece of code I mean. If you have any problems, I can do it for you.

The problem is the semantic of those tokens. You have to decide how to handle them. Unfortunately, I can't help you with it, I don't know the Poser 6 file format, neither I have Poser 6 installed. Anyway, you can always ignore the tokens. Use the _ignoreBlock method as I did, to avoid the problem.

Best,
M
So it doesnt just take the poser natave files and converts them to the file types for orge? (.mesh/.metrial/.skeltion) with just a simple import/export GUI?

Bummer...