Not logged inOpenClonk Forum
Up Topic General / Help and Questions / Exporting Clonks
1 2 Previous Next
Parent - - By Randrian [de] Date 2018-05-01 19:42
Finally, after a lot of fiddling with different transformations and comparing the newly exported files with an old file, I finally managed to export a new Clonk!
The updated version of the exporter can be found at:
I also finally found how to get rid of the ik chain that Blender always complained about. But I haven't found the current resource repository url yet. The one on OpenClonk is not reachable at the moment.

I also though about creating a version of the exporter that is directly integrated in the .blender file of the Clonk to make the installation easier.
And yes, I should probably do a tutorial about how to use the Clonk model properly. In the end its not that complicated if one knows what to do.
Parent - By Clonkonaut Date 2018-05-01 22:36
The repository is currently down, yes. There was a major problem. Can you attach the blend file to your post, maybe?
And yes, a tutorial would be highly appreciated :D
Parent - By Marky [de] Date 2018-05-02 17:36
Good news!
Parent - - By Randrian [de] Date 2018-05-05 22:02
After a lot of work with Python scripts in Blender, I now have a new version of the exporter working!
The current version now includes all necessary files within Blender, so no need to install anything. Just open the clonk.blend file and go.

In order to start the additional interface, you have to click "Reload trusted" in the middle of the top widget of the window.

To export the clonk now select the clonk object and hit the button "Export Mesh" or "Export Skeleton" in the right pane of the 3D view window. The names of the files are configured so that they can be directly used in Clonk.

So this should be the easiest possible version of an exporter for our Clonks. No installation just one Click and you get the correctly exported files.

or well so far the theory ;-) we still have to see if other people can also use it. To clariy some details, I want to write a tutorial. Where would be the best place to put a tutorial? In the Docs wiki probably?

And here is the link to try the exporter:

Feedback is appreciated, and some features are still planned, like exporting single animations.
Parent - By Clonkonaut Date 2018-05-06 13:50
That's awesome :o
I don't have time to look at it today but I will do!
Parent - - By Produzilla Date 2018-05-09 13:07 Edited 2018-05-09 13:13
Hey, I tried your new blender file but i didn't worked.. there is an blender error when trying to export mesh or skeleton.

May be i need to install special phython plugins or so? I just installed the newest blender version. As an old ClonkRage modder i hopefully tried your new model as a chance for me to finally "leave" the  ClonkRage World, so im looking forward to get a tip how to use it correctly ;)
Parent - - By Randrian [de] Date 2018-05-13 08:35 Edited 2018-05-13 11:27
Well, thats why a beta test is crucial ;-)
Its not your fault, but mine, I had a blender add-on installed to which the clonk export relied upon. I will solve this problem.

EDIT: I now have updated the file at the link. The current version shown now work.

I also started on a documentation how the file works:
Parent - - By Produzilla Date 2018-05-16 22:48
Hey, first thanks for the fast reply! I tried it again and the blender export now worked without any error messages. But there is a new problem :  When i put the mesh and skeleton file into the clonk.ocd ( still made a copy of it in an extra scenario) with simple overiding the original files, the model dosent work.. Ingame the clonk has no mesh and the engine logs this:

[23:34:11] WARNING: parameter 0 of call to 'SetMeshTransformation' passes int (array expected) (in GrappleHook.FxIntGrappleControlTimer, Objects.ocd\Items.ocd\Tools.ocd\GrappleBow.ocd\Hook.ocd\Script.c:330:47) [arg_type_mismatch]
[23:34:11] WARNING: parameter 0 of call to 'SetMeshTransformation' passes int (array expected) (in GrappleHook.FxIntGrappleControlTimer, Objects.ocd\Items.ocd\Tools.ocd\GrappleBow.ocd\Hook.ocd\Script.c:331:47) [arg_type_mismatch]
[23:34:11] WARNING: parameter 0 of call to 'SetMeshTransformation' passes int (array expected) (in GrappleHook.FxIntGrappleControlStop, Objects.ocd\Items.ocd\Tools.ocd\GrappleBow.ocd\Hook.ocd\Script.c:365:39) [arg_type_mismatch]
[23:34:11] WARNING: parameter 0 of call to 'SetMeshTransformation' passes int (array expected) (in GrappleHook.FxIntGrappleControlStop, Objects.ocd\Items.ocd\Tools.ocd\GrappleBow.ocd\Hook.ocd\Script.c:366:39) [arg_type_mismatch]

I just opend your blender file and exportet the files without any changes in the blender file.. Im wondering what i am doing wrong again.. or is it still my status as beta tester? ^^
Parent - By Caesar Date 2018-05-18 00:16
That log output seems unrelated...
Parent - - By Randrian [de] Date 2018-05-19 21:08
I also think that this output is unrelated. But if you cannot find the problem, you can send your exported files and I can try them with my OpenClonk installation, if you want.
Parent - - By Produzilla Date 2018-05-20 11:43 Edited 2018-05-20 12:38
You both are correct, it was a bit late that evening and i made some stupid copy and paste errors.. I fixed the mistakes, but it still doesent work. The engine says now, that it coudln't load the *.jpg files and the materila for mesh cannot be found.. :

[12:36:19] Failed to read material script: C:\OpenCkonk Modding\eclipse workspace\Openclonk\NewWeaponDevelopmentTest.ocs\Clonk.ocd/Scene.material:24: Could not load texture 'clonkAdventurer.jpg'
[12:36:19] Failed to load mesh in definition C:\OpenCkonk Modding\eclipse workspace\Openclonk\NewWeaponDevelopmentTest.ocs\Clonk.ocd: The material referenced by a mesh or submesh is not defined

@Randrian: I've sent  my files to you via dropbox.
Parent - By Pyrit Date 2018-05-20 12:57
Seems like it's looking for a jpg but in the folder are png's.
Parent - - By Clonkonaut Date 2018-05-20 13:38
You either have to provide the file "clonkAdventurer.jpg" or edit the Scene.material file to look for clonkAdventurer.png
Parent - By Produzilla Date 2018-05-20 19:29
-.- oh man. "Der Wald vor lauter Bäumen und so..." Of course, now it works.. Thanks guys!
Parent - - By Clonkonaut Date 2018-06-04 22:43
I tested around and exporting definitely works. However, I can't get it to export a material file or recognise a material file, I copypasted from the original clonk modell.

I am also still completely helpless when it comes to animating new things. I started out copying the 'AimArmsGeneric.R' animation and tried making a different aiming animation. However, when moving these constraints around, I get the weirdest results and I have no idea how to solve those (these are completely unrelated to your changes, mind you, I had similar results before).

If anyone has any suggestions on how to deal with this, It'd be much appreciated.

Moving the left arm around, twists the shoulder:

Rotating the left arm around, twists the wrist:

In my very first attempt (some time ago now), I proceeded to micro manage all the twisted bones and untwisted them until it looked good in Blender. When exporting, animation looks completely different from what it does in Blender and it just doesn't work.
Parent - - By Matthias [de] Date 2018-06-05 21:45 Edited 2018-06-05 21:59
/usually/ there is a bone somewhere that controls where the elbow is "aimed", which is quite important if the arms are streched out that much

I just checked, there is: It's arrow-shaped and has the name "ellbow.L" respectively "ellbow.R"
Parent - - By Clonkonaut Date 2018-06-05 22:30
I see. Many thanks!
Parent - - By Produzilla Date 2018-06-07 22:31 Edited 2018-06-07 22:43
I also tested the model alot and for me it works very fine. only thing: sometimes blender crashes without any log message while switching keyframes in posemode..but good old "save after every change" keeps this problem small..

@Clonkonaut may be i could help you with new animations for the clonk. i already made alot in the old clonk.blend file for CR an right now i made two new animations for the OC Clonk : AimLow and AimHigh. Im going to add several reload an shooting  animations  and so on.. I also scripted some modifikations for the exact weapon position depending on the aimmode and i added a muzzleflash effect with an attached mesh so tha the "muzzle flash" fits always the perfect position, even while walking or fast chnages in the aim_angle.

@Randrian : Thumbs Up for that nice blendfile, it mades my stepover to OC finally happen ;) One tipp for your tutorial: you should also give a hint that you have to add the new actions also in the actions.txt file, which has to be in the same folder as the *blend file. took me some time to figure out why the new actions in blender weren't exported to the *.skeleton file...^^
Parent - - By Clonkonaut Date 2018-06-07 22:46

> sometimes blender crashes without any log message while switching keyframes in posemode

Yeah, same for me.

Those aim animations look good. CMC could probably use those!
Parent - - By Produzilla Date 2018-06-07 22:54
Give some more days and i'll load up a first build of my project including the clonk, some weapons and lot of scripting stuff related to them. I used markys shooterlibrary as base, my own ideas for an ww2 related pack and the discussion about CMC for OC as isnpiration (espacially my ideas relating on weapon behaviour and stuff like that were nearly the same ;) )
Parent - By Marky [de] Date 2018-06-11 13:36
Be aware though, that we changed some stuff in the library for CMC (although not too much).
Parent - By Clonkonaut Date 2018-08-15 13:48
Did you upload your project somewhere by now?
Parent - By Randrian [de] Date 2018-06-08 22:54
Hey, I am glad to hear that you are happy with the .blend file!

I didn't have any problems yet with blender crashing...

@Action.txt yeah, maybe I should move the information from the action.txt to the properties of the actions in Blender... But I would probably still need the groups.
I also thought about some smart logic that deducts from the helper bones which bones of the main armature to export to make the groups obsolete...

Also still on my TODO-List is a button to export just the current animation, this should make it easier to make animations for add-on projects.

@matieral file, I did not implement the material file (yet) because I thought it is probably better/easier to edit that one by hand. But yes, this is also not communicated anywhere yet.
Parent - By Randrian [de] Date 2018-06-08 22:48
Yes, the problem is that the arm bending is ambiguous when only the position of the hand is given, therefore the elbow and knee helpers are needed.

Btw. I even mentioned them when describing the rig in the first version of the tutorial: but apparently not prominently enough ;-) Thats why I need feedback.
Parent - - By Clonkonaut Date 2018-04-22 02:15 Edited 2018-04-22 02:17
I fiddled around again for another hour or two. Having Randrian's exporter work with Blender v2.76b isn't too difficult, just commenting out the three lines that apply rotation/scale/position as these need some kind of context and I don't fully get Blender plugin programming.
For testing purposes, I added an option to not export with the DummyRootBone. Turns out, that is not really the problem here. The order in which the bones are exported has changed as well. So all vertex assignments connect to a different bone ID. I don't know if it's even possible or desirable to revert the blend-file to a state in which it was when the current exports where being done.

However, this does mean, re-exporting the adventurer clonk means re-exporting all the skins and fix those (the farmer esp.). Animations are luckily linked to the bone names (which actually is why Marky's skin exports work), so it's probably possible to use the old animations and copy those from the skeleton file. Not ideal though, if we want to get to a working and exportable clonk model. In that case, animations need fixing. Oh dear.

ScaleTop is broken right now, with twisted ankles (see screenshot). I fear that this got something to do with it. I already mentioned the eyes often being detached from the animation. And yeah. I haven't look at all the animations. When it comes to to the blend file, I don't know where to find the animations, to be honest. There are multiple armatures in there and I don't know how that works. I can't get the NLA Editor to actually display me the animations. They get exported, so they must be somewhere. But I don't know where to look. Does anyone know?
Parent - - By Randrian [de] Date 2018-04-22 09:32
The animations can be found in the action editor. You have to select the CONTROL_body armature and select the animation from the action editor. There you can change the key frames. I really should write an tutorial on how to handle the Clonk.

I am not 100% sure, what caused the shuffling of the bone indices, but the old exporter (from which mine was derived) used the order of the vertex groups, the current version of the blender exporter (ogre homepage) sorts the bones by the order they are in the armature (some sort of one bone then its children, then the next bone).

What we could do, is use the new sorting and then we have to re-export all existing clonk meshes (I don't know how many there are?). Or we try to get an exporter working, that maintains the old, a bit strange, order.
I already wanted to put some time into this, but haven't had enough time for that yet.
Parent - - By Clonkonaut Date 2018-04-22 10:36

> I don't know how many there are?

Four. But the farmer skin got some weirdness with its face and hair. All four skins are in different layers in the blend file.
Parent - - By Randrian [de] Date 2018-04-22 11:31
Well, no I meant how many other exported meshes of the clonk there are. Like external project that we would break when we would change the bone order.
Parent - - By Clonkonaut Date 2018-04-22 11:40
As far as I know, only Marky got projects with successfully working clonk skins. And he always uses an override to the skeleton, changing the bone order but keeping the animations (and with the New Order(tm) anyway). So those shouldn't break.
Parent - - By Randrian [de] Date 2018-04-22 12:26
Hmm, I don't think that, that would work, in the Graphics.mesh.xml the vertices are assigned to the bone indices:
        <vertexboneassignment vertexindex="21" boneindex="0" weight="1" />
        <vertexboneassignment vertexindex="22" boneindex="7" weight="0.999789" />
        <vertexboneassignment vertexindex="22" boneindex="9" weight="0.996011" />
        <vertexboneassignment vertexindex="23" boneindex="7" weight="0.500037" />

so changing the skeleton breaks the mesh. But if there are not that many other clonk meshes out there, that shouldn't cause too much of a problem.
Parent - - By Clonkonaut Date 2018-04-22 12:28
Yeah, no. Marky's project always supply a new mesh and skeleton file (with correct assignments) and just use the animations from the original clonk (which use the bone names).
Parent - By Randrian [de] Date 2018-04-22 12:34
Ah ok, then this does not break the animations.
Parent - - By Marky [de] Date 2018-04-22 18:56
Oh, that means that it should work even if the Clonk got exported with the dummy bone? Neat :)
Parent - By Clonkonaut Date 2018-04-22 22:21
Yeah, that shouldn't matter.
Parent - - By Clonkonaut Date 2018-04-22 12:35

> action editor

Cool! Time and try to do some new animations.
Parent - By Zapper [de] Date 2018-04-22 12:43
Parent - By Marky [de] Date 2018-04-22 18:58
Also, keep in mind that if you have a definition that has an "appendto.Clonk.skeleton" it will add those animations to the Clonk, so you do not have to export everything again. It is in the tests folder somewhere, Randrian made a bed with a sleeping animation.
Parent - - By Clonkonaut Date 2018-04-23 00:36
No real success so far. The animation turns into garbage when exported. :/ Looks fine in Blender though.
I should use these helper bones from CONTROL_body, correct? Are there other things to adhere to?
Parent - - By Marky [de] Date 2018-04-23 17:13
Keep in mind that you have to reset the bone transformations in pose mode (clear all transformations) before/after every export. Randrian once said that he has an animation that should reset this, but you can see if something is messed up in the current blend file (in mine it was).
Parent - - By Clonkonaut Date 2018-04-23 17:30
In that case, I don't know what exactly needs clearing and to what extend and what to select.
Before starting the animation creation process, I cleared all transformations. And just before performing the export, I do the following steps:
- Select CONTROL_body in the Outliner
- Pose mode is preselected
- I select everything (two times A)
- Pose > Clear Transform > All
- Switch to Object mode

Do the exact same steps with Armature and Clonk (as they are named in the Outliner). So right before exporting, I get this view (see attached screenshot). Still, the animations are broken.
Parent - By Marky [de] Date 2018-04-23 17:33
What you are doing sounds very sane - I would not expect the export to fail in that case. It's tricky then :)
Parent - - By Clonkonaut Date 2018-04-27 00:03
Ah. The problem was the missing DummyRootBone. With that option activated, the animations export just fine.
Parent - - By Caesar Date 2018-04-27 03:26
So we're able to export the clonk again? Yay!

Is this somehow automatable, as in we can throw it into a sansboxed test script or so? Or does this requre lots of smart human interaction?
Parent - By Clonkonaut Date 2018-04-27 07:36

> So we're able to export the clonk again? Yay!

Not exactly, no. I was able to do that (export) before but with all the problems described in this post.
Parent - By Marky [de] Date 2018-04-28 10:17

>+ 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)

The vertex information of the mesh has to have the same name as the skeleton. See in our models repository my explanation in the ClonkBasic folder (it is more accurate than my post here)
Up Topic General / Help and Questions / Exporting Clonks
1 2 Previous Next

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill