A Cinema 4D exporter

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
User avatar
Licorna
Kobold
Posts: 32
Joined: Thu May 19, 2005 7:22 pm
Location: Avignon, France
Contact:

A Cinema 4D exporter

Post by Licorna »

Hello everybody.

I'm developping an exporter for the modeling tool Cinema 4D.
Here is a test version which only (but fully) exports not animated meshes :
http://perso.orange.fr/licorna/Ogre3D_E ... er_en.html

A list of current functionalities of the exporter is viewable on my website (see above), and I also plan to implement animations export if I am able to.
I hope this will help some members of the Ogre community.
You can contact me on this thread, by private message, or by email for suggestions or for bugs reporting.

Licorna.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19265
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

Thanks for contributing this. I don't use C4D but I'm sure there are people out there who will appreciate this work.

Do you intend to release the source code for this tool? If so, we can provide a CVS home for it to live in.
User avatar
Licorna
Kobold
Posts: 32
Joined: Thu May 19, 2005 7:22 pm
Location: Avignon, France
Contact:

Post by Licorna »

Yes, I would want to release the source code, since I want my tool to be open.
CVS could be interesting to share my work and make evolving it faster, so I would be glad if you could provide me a CVS home.
Thank you for your interest.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19265
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

Please set up a Sourceforge account if you have not already done so, and mail me your user name. I'll set up an area in ogreaddons for you to commit the source code to.
User avatar
simply
Halfling
Posts: 45
Joined: Mon Jun 12, 2006 10:45 am
Location: Switzerland
Contact:

Post by simply »

I also use Cinema 4D and I am very glad to hear that someone takes the task and make an ogre plugin for it!
I tried your plugin (with C4D 9.603) and I found some bugs:
- When I hit the "Ogre Exporter" start button in the plugins menu the plugin window appears only some times...
- I have "Null Objects" in my scene, I think your exporter becomes confused from them, so your plugin only exported the first "Polygon Object" in the scene (I checked "export all")
- UV coordinates are not correct

Keep up the work!

If you release the source code every Cinema 4D user here can help you, such as me. :)

EDIT: Are you developing this plugin with COFFEE? I suggest to take the c4dsdk and write it with C/C++ and compile it to a .cdl...
User avatar
Licorna
Kobold
Posts: 32
Joined: Thu May 19, 2005 7:22 pm
Location: Avignon, France
Contact:

Post by Licorna »

Thanks for your encouragements and your help. :D

First of all, the exporter dialog only opens when the scene contains polygon objects to export (I have to modify this).
I have not remarked any perturbations caused by "Null Objects" since the exporter automatically exports all child polygon objects of the "Null Object" (if there are some) as submeshes.
For the UV coordinates, I have not remarked any problem after some complementary tests, so I would be glad if you could send me by mail your C4D file containing your problematic scene. This could allow me to see my mistakes if I've made some.
To answer your question, the exporter is coded in COFFEE because this script language is easily debuggable with the Console Window of Cinema 4D, but I plan to rewrite my code in C++ to make it more stable as soon as I will be sure the basic functionalities of the plugin works well.
Last edited by Licorna on Fri Jun 23, 2006 11:44 pm, edited 1 time in total.
User avatar
Licorna
Kobold
Posts: 32
Joined: Thu May 19, 2005 7:22 pm
Location: Avignon, France
Contact:

Post by Licorna »

The exporter source code is now commited on the ogreaddons CVS for those who are interested in.
Thanks to Sinbad for having created a directory for it. :)
Gauntlet
Gnoblar
Posts: 17
Joined: Sun Apr 09, 2006 4:58 pm
Location: Austria
Contact:

Post by Gauntlet »

Ha, great news.
Thank you for this. Our artist is using Cinema4D and it was always a bitty, that there wasn't any exporter for C4D available. :)
User avatar
Licorna
Kobold
Posts: 32
Joined: Thu May 19, 2005 7:22 pm
Location: Avignon, France
Contact:

Post by Licorna »

I'm back after a month of silence working on the plugin.
I've migrated the source from the Cinema 4D script language to C++ using the Cinema 4D SDK.
Also, I've begun to work on skeletal animations export but I experience some problems with bone rotations. Let me explain them.

First, after a look on this forum, I've seen I should use global coordinates for the root bones of the skeleton and relative to parent coordinates for child bones. Doing this, rotations are correctly exported uniquely for bones positionned at (0,0,0) in global coordinates. Using the Cegui Mesh Viewer, I've noticed that bones which aren't in this particular position were rotating around an incorrect axis.
For information, I'm retrieving angle/axis from the global or local matrix of the bone with a SDK function that internally uses quaternions.
Then, I remarked that Cinema 4D uses a left-handed coordinate system (the opposite of Ogre's one).

So, I would like to know if the difference of handedness could be at the origin of the mistake, or if I'm doing something wrong in my export method I've quickly described you above.
If nedded, the unstable source is on the ogreaddons CVS, and a compiled plugin (without animations export) is always available on this page (I've corrected the normals calculation algorithm which was totally wrong).

Thanks for your help.
Cinema 4D Exporter : http://perso.orange.fr/licorna
User avatar
DasGurke
Halfling
Posts: 86
Joined: Wed May 24, 2006 11:15 am
Location: Hamburg, Germany
Contact:

Post by DasGurke »

Just a quick "Thank You!" This is really helpfull for me =)
3Ddos
Gnoblar
Posts: 2
Joined: Sun Dec 24, 2006 5:59 pm

Post by 3Ddos »

Hi at all. Thanks for your pluging Licorna.

I´m a cinema 4d user release 9.6 and recently I have needed to export meshes from cinema to ogre and I do it well with your plugin, but the plugin doesn´t export the textures and I need to do.

How can I do. I need your help.

Sorry for my english.
User avatar
Licorna
Kobold
Posts: 32
Joined: Thu May 19, 2005 7:22 pm
Location: Avignon, France
Contact:

Post by Licorna »

At this time, the plugin only include a link to a .material file in the .mesh. This means that if you have a texture called "tex" in Cinema 4D, you will have a default material named "tex" which will be applied to the mesh when you load it in an Ogre app. But, the plugin doesn't create this "tex.material" file and you have to do it yourself.
I plan to add this functionnality in the future.

I also want to announce that a new version of the plugin allowing to export skeletal animations is now quite stable and will be released soon.
Cinema 4D Exporter : http://perso.orange.fr/licorna
3Ddos
Gnoblar
Posts: 2
Joined: Sun Dec 24, 2006 5:59 pm

Post by 3Ddos »

Thanks.

I understand you and I will work in thats way but I hope that you develop thats function soon because its very important for me.

I hope the new features in this plugin.

Thanks again and Bye
User avatar
Licorna
Kobold
Posts: 32
Joined: Thu May 19, 2005 7:22 pm
Location: Avignon, France
Contact:

Post by Licorna »

The new version of the plugin allowing to export skeletal animations is released.
The source code is available on the Ogre Addons CVS and a binary is available for Cinema 4D 9, 9.6 or 10 (PC only) here : http://perso.orange.fr/licorna/Ogre3D_E ... er_en.html

I can't provide binaries for older Cinema 4D versions since the corresponding Cinema 4D SDK are not downloadable on Maxon's website. So, if you own an older Cinema 4D version, contact me.

Licorna.
Cinema 4D Exporter : http://perso.orange.fr/licorna
Psionic3d
Gnoblar
Posts: 6
Joined: Tue Jul 06, 2004 9:55 am
Location: uk
Contact:

Post by Psionic3d »

Awesome news, keep up the great work!!

I'm also trying to preview the model/animation in unwrap3d and after converting with the command line convertor the mesh loads (with unwrap3d's ogre plugin) and loads the skeleton but its no longer fixed to the mesh and rotated by 90 degrees...I used simple bones and point restrictions in Cinema 4D

one more question, Do you have any plans to support the new joints/IK/bind system in R10?? I cant seem to get them to work so far...and they are so Awesome and easy to setup and rig stuff with!! ;-)

p.s. maybe consider putting a paypal donate button on your page, I'd certainly like to help get this plugin working fully!! ;)
User avatar
Licorna
Kobold
Posts: 32
Joined: Thu May 19, 2005 7:22 pm
Location: Avignon, France
Contact:

Post by Licorna »

I've never used Unwrap3D and its Ogre plugin, so I can't help you a lot to use it...
But, I would like to know if the model (mesh + skeleton) is correctly exported by the Cinema 4D exporter to determine whether the problem is engendered by my exporter, or by the Unwrap3D plugin. If possible, I'd like you to send me your .c4d file by email in order for me to do some testing.

At this time, I've not paid a sufficient attention to the new R10 features to determine what I should implement in future versions. First, I'd want to make sure that the basic features already implemented are working well and I'd want to extend the support for older Cinema 4D versions, and also for the Mac platform.

Following your advice, I've put a Paypal button on my website, feel free to use it as you want. :wink:

Thanks
Cinema 4D Exporter : http://perso.orange.fr/licorna
mirsch
Gnoblar
Posts: 1
Joined: Mon Jan 15, 2007 10:12 am

Post by mirsch »

Hi,

Thank you for the plugin. Good work so far.
But i noticed some strange behaviors. Are you sure conversion between c4d and ogre coordinate system is correct?
The mesh seems to be mirrored.
It's hard for me to explain this in english so here is a cinema screen shot (just a stupid test):
http://img207.imageshack.us/img207/184/c4dlc6.jpg (Yes i know, the dots in the texture are wrong) And here comes the screenshot from inside ogre: http://img291.imageshack.us/img291/6729 ... ot2ig7.png it's hard to see so here is an other one using wireframe http://img291.imageshack.us/img291/9289 ... ot1vf5.png
As you can see the mesh looks mirrored along the Y-axis.
LEGONOIZ
Gnoblar
Posts: 1
Joined: Thu Apr 12, 2007 5:43 pm

Problems with export from cinema 4D R10 to OGRE

Post by LEGONOIZ »

Hello. Thank you for new pluging.


Unfortunately, there are some troubles in its using. Plugin exports from cinema 4D R10 to OGRE all elements of the model, except skeleton and its animation. I can send you the initial file, if it is necessary.

I’ll be very pleased to you. Thanks. :))))))))))))
User avatar
Licorna
Kobold
Posts: 32
Joined: Thu May 19, 2005 7:22 pm
Location: Avignon, France
Contact:

Post by Licorna »

Hi,

Your problem is maybe due to a wrong hierarchy of the elements in the model, or to missing restriction tags. You should send me your .c4d file by email and I'll verify it (I have sent you my address by PM).

I know there are still some bugs in the plugin, including the axis problem, but I'm a very busy student and I have not enough time to correct it for the moment (maybe during my summer holidays... ). I also plan to release a small documentation explaining how to organize the models in order for them to be exported correctly by the plugin.

Thanks for your comprehension.
Cinema 4D Exporter : http://perso.orange.fr/licorna
User avatar
Deamon
Gremlin
Posts: 155
Joined: Mon Jul 28, 2003 8:01 am

Post by Deamon »

Hey a C4D exporter :)

Man how long have i waited for this. Thank you so much Licorna!

However i have some show stopping problems with it on C4D 9.0

First of all, meshes with approximately more than 10000 tries get screwed. Here is an example of an cylinder with 11200 polygons:
http://www.dreadnoughtproject.org/heinr ... shot_2.png

Polygons above 10000 get screwed.

Here is a mesh view:
http://www.dreadnoughtproject.org/heinr ... shot_3.png

As you can see there are polygons inside the cylinder that didn't existed in the original model before export.

Here's an view from inside the cylinder:
http://www.dreadnoughtproject.org/heinr ... shot_4.png

Below 10000polygons everything looks fine:
http://www.dreadnoughtproject.org/heinr ... shot_1.png

Exporting seems to take very long for an 10k polygon mesh, something like 10 minutes on a quite fast machine.

What is the deal with it ? Or do i make something wrong ?
IMPERIAL U-FLOTILLA 1914-1918
Image
http://www.dreadnoughtproject.org/heinrich/main.htm
Current stage: 2 - pre alpha
User avatar
Licorna
Kobold
Posts: 32
Joined: Thu May 19, 2005 7:22 pm
Location: Avignon, France
Contact:

Post by Licorna »

Hi Deamon,

The UV coordinates exporting option results in the execution of an algorithm that modifies the polygonal structure of the object in order for a vertex not to be shared by many polygons.
Try to disable the "Export UV coordinates" option. This should correct your problem and make the exporting faster.

Regards,
Licorna.
Cinema 4D Exporter : http://perso.orange.fr/licorna
Croco
Gnoblar
Posts: 19
Joined: Tue May 01, 2007 1:21 pm

Post by Croco »

Unfortunately, there are some troubles in its using. Plugin exports from cinema 4D R10 to OGRE all elements of the model, except skeleton and its animation. I can send you the initial file, if it is necessary.
i have the same problem how can i fix it
Your problem is maybe due to a wrong hierarchy of the elements in the model, or to missing restriction tags.
how is the good hierarchy of the elements ??
User avatar
Licorna
Kobold
Posts: 32
Joined: Thu May 19, 2005 7:22 pm
Location: Avignon, France
Contact:

Post by Licorna »

The rules to follow are :

:arrow: The skeleton must be a child element of the object to export.
:arrow: For each bone of the skeleton, you must define a vertexmap which fits the behaviour of the bone.
:arrow: Each vertexmap must be assigned to the corresponding bone using a Restriction tag.

I hope it will help. If not, ask me more.

Licorna.
Cinema 4D Exporter : http://perso.orange.fr/licorna
Croco
Gnoblar
Posts: 19
Joined: Tue May 01, 2007 1:21 pm

Post by Croco »

i don't use bones i use joints in Cinema4d 10
User avatar
Licorna
Kobold
Posts: 32
Joined: Thu May 19, 2005 7:22 pm
Location: Avignon, France
Contact:

Post by Licorna »

I'm sorry but the plugin doesn't allow joints exporting.
Cinema 4D Exporter : http://perso.orange.fr/licorna
Post Reply