Not logged inOpenClonk Forum
Up Topic General / Help and Questions / Exporting Clonks
1 2 Previous Next
- - By Marky [de] Date 2015-10-31 20:34
How can I export Clonks? The one in the resources repository that has animations is the female clonk. I understand that the other skins do not need to export the animations again, since they share the same skeleton. However, I do not see an armature in the other clonk *.blend files, so how does the export work? I am asking because making new clonk graphics or modifying the existing ones is something I want to do in the future.

Other issues:
- The clonk mesh and the test object mesh got exported correctly with Randrian's exporter. What is the difference from this exporter to the standard ogre exporter?
- I need to set "swap axis" to "xz-y" in the export dialogue. This is not in the tutorial.
Parent - - By Clonkonaut Date 2015-11-03 00:25
Unfortunately, the clonk model hasn't been touched for a long time. I don't know if anyone except for Ringwaul and maybe Randrian have ever used it. Ringwaul set this up in a way no one else understands.
I would be nice if anyone with Blender experience could get a hang of that file and maybe clear things up.

> The clonk mesh and the test object mesh got exported correctly with Randrian's exporter. What is the difference from this exporter to the standard ogre exporter?


Randrian's exporter is supposed to do some OC specific stuff. Applying rotation / scale (that's not exactly OC specific) and naming the files the right way.

> I need to set "swap axis" to "xz-y" in the export dialogue. This is not in the tutorial.


We recently changed the way the camera looks at objects because Ogre mesh viewers where always using a different way. The model definitely wasn't updated, so maybe that's not a general thing to do.
Reply
Parent - By Newton [de] Date 2015-11-03 18:11

>except for Ringwaul and maybe Randrian have ever used it. Ringwaul set this up in a way no one else understands.


Nope, the other way round
Parent - By Marky [de] Date 2015-11-03 18:36

>> I need to set "swap axis" to "xz-y" in the export dialogue. This is not in the tutorial.
>We recently changed the way the camera looks at objects because Ogre mesh viewers where always using a different way. The model definitely wasn't updated, so maybe that's not a general thing to do.


This does not apply to the clonk model, I have to do this with every model I create. I use the num-block-3 perspective in blender when modeling.
Parent - - By Apfelclonk Date 2015-11-03 09:50
All clonks are saved in the ClonkOpenRevolution.blend. In blender at the bottom bar of the 3D View-window there is an area with 2x10 boxes. There you can toggle on/off different layers and there, where the other clonk meshes are hidden. These ones are already connected with the skeleton, so you can export them.

>The clonk mesh and the test object mesh got exported correctly with Randrian's exporter. What is the difference from this exporter to the standard ogre exporter?


As it is already mentioned, there is no big difference. Randrian kindly made few adjustments, which reduce the amount of error sources in the exportation-step to make them OC-viable.
Reply
Parent - - By Marky [de] Date 2015-12-17 23:14
Thanks, that worked for exporting the mesh. I could not get the skeleton to work properly, though (exporting animations for other objects are not a problem): the skeleton does not contain all animations, the NLA editor shows about 3 anymations, I cannot select or deselect there. Everything is exported as "my animation".
I tried exporting the mesh only and using the existing skeleton, but this does not work either: The vertex coordinates are somewhat in the wrong position, so that the mesh looks a bit like a gorilla when the animation is applied. I can post screenshots later
Parent - - By Apfelclonk Date 2015-12-18 10:30
That's a problem that I had a few weeks too. Actually, the Clonk Model doesn't use NLA Strips. But the exporter recognizes Actions as defined in the Action editor too, if you tell him to. To do so, you have to create an Actions.txt in the same directory the .blend is in. Try this and add your animations.
Reply
Parent - - By pluto [ch] Date 2016-02-11 23:51
Is there a description somewhere how that works?
Parent - By Apfelclonk Date 2016-02-14 11:48
Reply
Parent - - By Marky [de] Date 2016-06-05 19:28 Edited 2016-06-05 19:45
I wanted to export Clonks meshes again, and did a new setup exactly as explained in the tutorial, with Blender 2.71 and the modified exporter plugin by Randrian. The problem is actually exporting the Clonk now (exporting other meshes works fine for me).

When I select everything by pressing "A" in the 3D-preview, then the export fails with some errors in the exporter plugin, probably because a parent object is missing. I got it to work once by also selecting everything with "A" in the outliner view. Unfortunately my export settings were wrong, and I wanted to reproduce it, but could not. Do you have any advice for me?

[Update]
Apparently it helps to select only the clonk in the outliner.

[Update]
This did not help very much, though, because the same problem as last time persists: The clonks have very wrong vertex assignment or a wrong skeleton after exporting.
Parent - - By Zapper [de] Date 2016-06-05 19:51
The Clonk skeleton uses a file called ActMap.txt or Actions.txt (not sure anymore..) to determine which actions should use which vertices. I don't actually know how that works, though
Parent - - By Marky [de] Date 2016-06-05 20:01
The skeleton contains animations, those are taken from Actions.txt, yes. In my test scenario I exported a Clonk and gave it its own definition, then I let my crew member take the graphics of that object with SetGraphics(). Then the vertex assignments are wrong, compared to the original clonk => the fingers and legs look warped, for example.

I tried decompiling the skeleton file of the OC 7.0 clonk to compare them, but that does not work:
20:52:11: OGRE EXCEPTION(7:InternalErrorException): Invalid file: version incompatible, file reports [Serializer_v1.80] Serializer is version [Serializer_v1.10] in Serializer::readFileHeader at ..\..\..\..\OgreMain\src\OgreSerializer.cpp (line 258)

Unfortunately, the only version of OgreXmlConverter.exe that I found on the ogre website has Serializer_v1.10. Where can I get a newer one? The ogre manual says something about downloading ogre and compiling it to get the .exe, but I do not want to do this.
Parent - - By Apfelclonk Date 2016-06-05 20:06 Edited 2016-06-05 20:09
You got windows? If so.

>The skeleton contains animations, those are taken from Actions.txt, yes. In my test scenario I exported a Clonk and gave it its own definition, then I let my crew member take the graphics of that object with SetGraphics(). Then the vertex assignments are wrong, compared to the original clonk => the fingers and legs look warped, for example.


Sorry for asking so dumb. You definitely not moved the skeleton a bit? Probably clear Transformation with Alt+G in Blender to be sure.
Reply
Parent - - By Marky [de] Date 2016-06-05 20:18
Thanks! Good, I found out what the problem might be. The exporter exports some bones that should not even be there, such as "DummyRootBone", and furthermore it exports them in a completely different order. This messes up the animations, obviously. The question is, how do you fix it?
My next approach would be to build the mesh that I want, export it with a dummy armature that is set up in the such a way that the bone names and vertex assignments correspond to the real skeleton. Then I'd export the Clonk with the dummy armature and replace the skeleton with the original clonk skeleton.

There has to be a better way though.
Parent - - By Apfelclonk Date 2016-06-05 20:32
Mh. You're trying to make an appendto-Skeleton? Usually when you export Mesh with Skeleton together it is synchronized.
But if you try to make a skeleton working with the original clonk mesh, it might be the best to convert the original skeleton to .xml and copy its bone-declaration section and paste it into the new skeleton.xml that you exported. You might need to add the DummyRootBone (if its declared in any animation track) but if you add it at last it should have the least index which is not used anyhow else.
Reply
Parent - - By Marky [de] Date 2016-06-05 20:41
I want to export a mesh with skeleton, and I do that with the openClonkRevolution.blend file. However, when I compare the exported files to the files in Clonk.ocd, then the exported version has the additional DummyRootBone, the order of the bones is completely different, and the animations look weird in the game.

Animations for meshes other than clonks were no problem for me so far.
Parent - - By Apfelclonk Date 2016-06-05 21:58
So which .mesh are you actually using? You either have to use the exported .mesh which is adjusted to the reorganized bones. Or if you want to use the original clonk mesh you might have to do what I tried to explain.
Reply
Parent - - By Marky [de] Date 2016-06-06 04:27 Edited 2016-06-06 04:36
I use the exported mesh together with the exported skeleton.

The problem that I see with your approach (simply exchanging the bone definitions) is: The mesh file contains the information what vertex is assigned to what bone. When I change those in the skeleton file only, then the vertices get assigned to the wrong bone and the model will still look warped. So, instead of manually adjusting all vertex assignments in the mesh file after exporting it, I suggested this. This cannot be the solution, though.

Someone exported the original Clonks and the export worked correctly for them, so it should be possible to reproduce this. All I want at the moment is exporting the original Clonk mesh + skeleton, insert it in a new definition, and see it work correctly.
Parent - - By Apfelclonk Date 2016-06-06 08:41

>The problem that I see with your approach (simply exchanging the bone definitions) is: The mesh file contains the information what vertex is assigned to what bone. When I change those in the skeleton file only, then the vertices get assigned to the wrong bone and the model will still look warped. So, instead of manually adjusting all vertex assignments in the mesh file after exporting it


My solution was actually to handle the case you just discribed. By reorganizing the bone defninitions to the order in the original clonk skeleton to fit its vertex assignments, if you don't use the exported .mesh. Because you do, this approach is obsolete.

But then I don't get your earlier mentioned problem either. With your fresh exported mesh and skeleton all indices and vertex assignments should be fine. And the additional DummyRootBone doesn't change anything substantial. Can you give some more detail (maybe a screenshot or somewhat like that)?
Reply
Parent - - By Marky [de] Date 2016-06-06 17:59
Fresh exported model and skeleton:
Parent - - By Apfelclonk Date 2016-06-06 18:27
That doesn't look as it would with having bone indices messed up (The parts would fly through the space, without being reasonable joint - got that issue when writing the meshviewer for Windmill >.>). It looks more like there is some bone offsetted incorrectly, which inherits through the bone hierarchy.

As you didn't answer the question I posed while ago, did you have cleared the object transformation of the skeleton and the model? That shouldn't be crucial anymore (I remember Randrian fixed it in his exporter-mod), but it would be good to exclude that error-source completely. (Clear with Alt+G or Apply with Alt+A -> Location)

I only have some wild guesses in repertory or I could test a bit on my own if you give me the files, but I don't have much concrete advise left.
Reply
Parent - By Marky [de] Date 2016-06-06 18:31
Nope, I will try that now.
Parent - - By Marky [de] Date 2016-06-06 19:08
Nope, does not work. I'll upload the files now, but they are from the repository anyway. It is hard getting the Clonk into scarecrow position in blender. First I cleared the armature, then the mesh, but that does not do much. Then I cleared the armature again, then cleared the mesh, then cleared the mesh in edit mode, then when I go back to object mode it is in the scarecrow position again. I saved the file in that state and exported it. This is my last test, I'll upload it soon.
Attachment: clonk.7z (2639k)
Parent - By Zapper [de] Date 2016-06-06 19:40
You can reset bone rotation with Alt+R (pose mode)
Parent - - By Apfelclonk Date 2016-06-06 19:57
There is some offest in the real skeleton. (These pins an rings shown originally are helperes to rig the actual skeleton). Display the layer with the skeleton (the one with XX - see below).

layers panel:

______________    ______________
(__|__ |__|__|__)   (__|__ |__|__|__)
(__|__ |__|__|__)   (XX|__ |__|__|__)

and select the skeleton in Object mode and apply its location transformation (Ctrl+A -> Location). Then it should be fine.

As Zapper mentioned to get into the scarecrow position just select a bone in pose mode, select all with A twice, and do Alt+G and Alt+R and you should've cleared all the pose transformation (even though it might be not displayed correctly at first).
Reply
Parent - - By Marky [de] Date 2016-06-06 20:25 Edited 2016-06-06 20:52
Did that, it helped a little, but there is still something wrong. The biggest question for me is: why is the model in the repository in that state? Could you fix it and commit the correct version?

When I apply the location in object mode and clear rotation and offsets in pose mode, then still not everything is rest correctly, the skeleton still has some non-default pose.

[Edit]
Cleaned the "rings", too, maybe that helps.

[Edit]
Do I have to "apply pose as rest pose" of the skeleton in pose mode? Because it always skips back to the old pose whenever I finished exporting.

[Edit]
I think another problem is that there is still some kind of action selected when I export the clonk.
Parent - - By Apfelclonk Date 2016-06-06 20:55 Edited 2016-06-06 20:59
I cannot tell you either why this looks so weird after exporting (I'm pretty sure that it never looked that way in my try-outs, when exporting the mesh with my own animations). But that the skeleton gets transformed whlie exporting is right. Its just part of the exporting process to go through the animation, that what you see is what's left over.

> it helped a little, but there is still something wrong.


What do you mean? Does the clonk now gets properly displayed ingame or not? Windmill shows me something plausible (only few errors, which I would assign to be meshviewer errors).

EDIT:

Anyway applying the pose to rest would only cause more problems.
Reply
Parent - - By Marky [de] Date 2016-06-06 21:00 Edited 2016-06-06 21:07
The arms are still incorrect, as if the Clonk was setting down a carry heavy object (this is also the animation that is selected there). This is the version with the pose reset, though.
Attachment: clonk2.zip (3304k)
Parent - - By Apfelclonk Date 2016-06-06 21:27 Edited 2016-06-06 21:36
Which blender version do you use (setup looks unhandy for anything > 2.49b)?

Are the options "Only Animated Bones" and "Only Deformable Bones" enabled in the export panel?

If so, that looks for me like a bug I have all the time too (just made a new model few days ago, where I guess animations haven't been cleared from empty transformation data, which leads to these static overrides of animations and incapability to blend). I did contact Randrian, who says from himself that it works all fine on his machine. Sadly he didn't find it out in the time he was able to spent.

EDIT:

Talking about clonks, you have set up your Actions.txt?
Reply
Parent - - By Marky [de] Date 2016-06-07 04:21
I am usung Blender 2.71 and Randrians exporter from renderclonks.de, as explained in http://wiki.openclonk.org/w/Exporting_Blender_Models.

Then I open stuff as it is in the repository: /models/Livings/clonk/ClonkOpenRevolution.blend, Actions.txt is unchanged.

I did not change anything, because I just wanted to export what I thought to be a working model. That blend file already has this strange setup when I open it. The files that I attached are my attempts at fixing the model. So, basically you have all the information that you need to replicate my problem from the first step.

"Only Deformable Bones" and "Only Animated Bones" are deactivated in the export panel. In the tutorial I did not see an example how the export panel should look like, so I set it up the same way as in my previous blender.
Parent - - By Apfelclonk Date 2016-06-07 07:50
As reference (and because it might be a more recent version) https://bitbucket.org/randrian/clonkblenderogreexporter/overview.
Reply
Parent - By Marky [de] Date 2016-06-07 20:28
Thanks. So, I am glad that it worked in the end. I am looking forward to creating a few custom clonks :)
Parent - By Marky [de] Date 2016-06-07 06:25
I started from scratch again and was successful. I had to unlink the selected action and clear the NLA tracks.
Parent - By Marky [de] Date 2016-10-15 07:55 Edited 2016-10-15 09:24
Small update: Since the original blend file is still hard for me to edit I tried yet another approach. Appending the armature object and the mesh that I want to use for editing in a new blend file works really well, the export works. It seems that there are still some offsets or something in the skeleton that I have to clean, but other this is really the simplest approach if you want to do a new clonk/skin that inherits the default animations. Just make sure to name the mesh "include.Clonk", or edit the exported .xml file accordingly => this makes the skeleton inherit all animations from the definition Clonk.

[Update]
- Removing the ik goals and shape targets helped a little bit.
- Solved that, too: Export coordinate systems were wrong. I use [xz-y] usually, have to use another one.
Parent - - By Marky [de] Date 2016-10-20 21:34
How is the center of the mesh graphics determined? I imagine by the coordinates in the model, but something goes wrong.... I have an object that has to graphics: Body and legs. These share the same skeleton, but they are separate meshes and have separate Graphics*.mesh files. Now, if I set graphics to "Legs", everything looks fine. On the other hand, if I set the graphics to "Body" the mesh seems to be about 40 pixels below the position where it should be. I cannot really explain why, because the armature origin is in the world origin in blender (did not change anything there), the mesh origin is also in the world origin in blender. Does anyone have any ideas?
Parent - By Armin [de] Date 2016-11-15 12:09
No clue but I once had less problems with mesh positions when I did not only started to make sure the object in Blender is in the origin but also that the highest vertices is as high as the lowest vertices is low. So the highest point is Z=14 and the lowest one Z=-14 (same goes for the other axis and ofc always apply rot/loc/size).
- - By Clonkonaut Date 2018-02-17 02:21 Edited 2018-02-17 02:23
Some time ago, Matthi pushed a fix to this bug.

In order to fix this and to be able to create new animations in the future, I tried to re-export the clonk meshes. I pushed this to a new branch: https://git.openclonk.org/openclonk.git/shortlog/refs/heads/clonk_re-export

This is what I have installed:
Blender 2.71
The newest version of Randrian's exporter (at least I hope so but it says 0.6.0).
Ogre Command Line Tools, but I guess, only the XML Converter is needed.
Python 3.5 (but I guess that newest version is fine)
ck's mesh converter tool

This is roughly what I did:
Opening \openclonk-resources\models\Livings\clonk\ClonkOpenRevolution.blender
Make the layer of the desired skin visible
Make the layer of the armature visible (don't know if this is necessary)
Export it, the standard procedure with the exporter
Run mesh-converter.py over the .mesh and .skeleton file

+ for the Alchemist and Steampunk skin:
Manually edit the .mesh file in a text editor (Notepad++ or something that doesn't fuck it up) so it does use 'Clonk.skeleton' instead of what it was before (the .skeleton file link being one of the few plain text parts of the .mesh file)

+ for the Farmer skin:
The UV Image is pointing to a location on Ringwaul's pc. So I did edit the texture to point to the correct file (which should be "//..\clonkFarmer\clonkFarmer.png")
Removed the empty material
Object > Apply > Make Duplicates Real (Shift Ctrl A)
Export
Do the same than with Alchemist/Steampunk: edit the .skeleton link.

This post is meant to collect problems with the new exports and attempt to gradually fix those and hopefully make the clonk exporting process more smooth.

Problems that I saw so far:
The eyes are often closed now. Before, the eyes' bones were often tied into the animations (this is probably a good thing, to decouple eyes from other animations).
Some animations have shifted positions (KneelDown but maybe more).
It looks to me as if some bone positions differ (when aiming e.g.).
With the steampunk skin, there are a few arm polygons / vertices wrongly connected.
The farmer skin is still broken because the hair isn't really properly connected to the mesh (probabyl something with those duplicates?) but I don't know how to fix it.
Reply
Parent - By Marky [de] Date 2018-02-17 09:27 Edited 2018-02-17 09:36
I did not try exporting the Clonks with animations, but the export itself worked quite well with 2.71.
This is either in the resources repository, or in my fork of it. I'll go online in IRC in about half an hour, so maybe we can try it together.

[Edit]
Did not upload this to the normal resources repository (it is there in my local repository, on branch "marky"), but I also added it to my github: https://github.com/gitMarky/OC_Resources/tree/master/models/Clonk
Parent - By Marky Date 2018-02-17 12:35
Checked it. I am running it on Blender 2.76, ogre exporter is the same. Exporting the default Clonk does not require me to edit the link to the skeleton file (well, it didn't require you to do that either). Will check the other skins in a few minutes.

Differences to your export:
- cleared all transformations on armature and CONTROL_body in pose mode. This should reset the Clonk to the scarecrow position (select the layer with the Clonk, select object mode, press tab a few times (or make the CONTROL_body layer visible))
- Yes, farmer needs this apply duplicates stuff, did not do that, so I did not export it.
- Selected only the meshes in the clonk skin layer, export still worked fine
Parent - - By Randrian [de] Date 2018-03-26 18:36
Hi all, after some time had a look into the Clonk forum, and I am a bit sad, that the exporting is still a mess, although I tried to make it nice :-(
Unfortunately, I have problems, too, with the current system to export the Clonk. Somehow my attachment-bones are rotated around 90°, i.e. the tools like the backpack are rotated by 90° while the Clonk is displayed right.
Maybe this is a problem with ck's orientation change.

I exported the skeleton with "xz-y" settings.

A general note on the setup of the rig. I tried to make the rig easy with the use of IK-Helpers, e.g. that you just have to place the hand and the arm follows automatically. That now seems to complicate things a great deal...
The idea of my implementation of the Actions.txt was to define a bit which bones should be exported for which action, to allow for blending between different animations, e.g. aim while walking. Most other models and rigs don't use much of that functionality. Maybe we need a more detailed tutorial on how to use the Clonk's blender file and how to export it properly.
Reply
Parent - - By Zapper [de] Date 2018-03-26 19:14
Hmmm, I think the main problem is not the rig itself with the IK helpers (I found them cool), but just that noone really seems to know exactly what has to be done to correctly export the model :I

(Or e.g. to export just one animation, in case you want to #appendto the skeleton)

Hi Randrian!
Parent - By Randrian [de] Date 2018-03-26 20:45
Hi Zapper!

Exporting just one animation should be in principle easy, as you just have to define an Actions.txt with one animation and export it. But yes, more documentation should help here.

I was quite surprised, to see my feature wish with the appendto animations implemented, I didn't remember it was already implemented on my feature request.
Reply
Parent - By Marky Date 2018-03-26 19:42
What Zapper said, and there is a difference depending on which exporter version you use. For example, I use the way older exporter, because the whole animation stuff with Action.txt does not work for me.

I work a lot with the OGRE .xml files and using the original skeleton without animations for new Clonks. On Clonkspot there are some examples in the Hazard and Clonk Mars threads.
Parent - - By Randrian [de] Date 2018-03-26 20:42
Ok, after some fiddling with the stuff myself, I have not been able to get a properly exported Clonk :-(

Did we have a exported clonk yet after the changes from ck?

I can get a good exported Clonk with animations, but the attached Items are rotated by 90°. And the bone order is different, causing other meshes to be broken with my exported skeleton.
So is there something different now how mesh appends are handled? has there been at some point an additional rotation around 90° when attaching?

Also I noticed that someone removed the "RESET" animation in the clonk, that my exporter used to reset the pose before exporting an animation. Also my fault, because I documented it nowhere that this animation is important....
Reply
Parent - - By Marky Date 2018-03-26 20:48
The newer version of the exporter adds a dummy bone to the Clonk and you should export with xyz axis swap, as far as I know. Ok, but this does not address why only the items are wrong. Items should not be in the exported model at all, should they? This could be a problem in the item, if it is a very old mesh (this is the CK thing you are talking about, had this years ago :))
Parent - By Randrian [de] Date 2018-03-26 21:41
ok, well, I am talking about the basic items, backpack, shovel, etc. so they should not be very old meshes ;-)
What do you mean with "newer version" of the exporter? The Ogre Exporter from the ogre page or the Clonk Ogre Exporter for Blender I wrote (or at least modified)?

So I can export the Clonk with my Clonk Ogre Exporter version (the one from my bitbucket repository) with the xz-y transform and the mesh and bones is right. There isn't by any chance a possibility to visualize bones in Clonk?

@years ago: I wasn't active for clonk some time, and found out that my old stuff for Harkon didn't work anymore, the I had to reexport all the models (didn't find ck's convert script).
Reply
Parent - - By Clonkonaut Date 2018-03-26 21:48
(Hi Randrian!)

The clonk was never successfully reexported after ck's change, no.

And also what Marky said: your exporter does add an additional bone called "DummyRootBone" to every exported skeleton. I don't remember why but it was done to fix something and the fix worked fine? (was it something about bone/vertex groups?) However, this means that the newly exported skeleton has one additional bone compared to the old one which will most likely cause a few problems. You could of course add another option to the exporter to not include this bone or removed it manually from the skeleton file (but I'd rather have a setup where the clonk exports fine without editing afterwards).
I didn't check the tools though. Maybe this will be fine if we just rotate the bones in the .blend file.
Reply
Parent - By Marky [de] Date 2018-03-27 17:33

>The clonk was never successfully reexported after ck's change, no.


Clonk + Skeleton as intended, I agree, not successfully export. Mesh only with some editing is doable.
Parent - - By Pyrit Date 2018-03-30 15:43
On a side note, the exporter sometimes produces broken materials.

Sometimes it inserts stuff into the .material file that the engine can't handle.  tex_coord_set = 0 to be specific. I made a bug report for that: https://bugs.openclonk.org/view.php?id=2010

Another problem with materials is that when you export an object with a uniform material without texture, you get the error Element 'vertex' does not contain 'texcoord' child from the engine.
Parent - By Marky Date 2018-03-30 22:07
To be honest, I never use the materials that the exporter created. Maybe I like text editors too much here, but I feel that I have the most control over it by writing the material by hand.
Up Topic General / Help and Questions / Exporting Clonks
1 2 Previous Next

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill