Navigation

    • Register
    • Login
    • Search
    1. Home
    2. sketchfab
    S

    sketchfab

    @sketchfab

    2
    Reputation
    6
    Posts
    48
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    • Profile
    • More
      • Following
      • Followers
      • Topics
      • Posts
      • Best
      • Groups
    sketchfab Follow

    Best posts made by sketchfab

    RE: Multiple animation import

    Hi Lads !

    FYI, the solution of playing each animation one after the other gave satisfying results 👍

    A tricky part though was to take into account joints animated in one animation, but not in others, hence keeping keyframed values where unnecessary.
    The naive but effective solution to this problem was to force joints to their rest position in the animations in which they are not keyframed.

    Another "trick" was to offset the animation tracks by a small margin. If an animation ends at 5000ms for instance, we make the other one start at 5001ms. This allows for the "forced" keyframes to interpolate correctly and not mess up the whole animation (strange things started happening when setting multiple keyframes at the exact same time frame, probably an undefined behavior...).

    For the "reference wolf", here is what the result looks like with an exaggerated margin between the animations is set to 1s (in practice, turning this value to something very small makes the transition immediate):

    Wolf gif

    Anyway, thanks @kbar and @m_adam for your suggestions, this case is solved !

    Cheers,
    Loïc.

    posted in Cinema 4D SDK •
    RE: Multiple animation import

    @kbar @m_adam Thanks for the help lads, the markers were already added thanks to Kent suggestion in his previous reply.

    Now the only things left are a little "GlTF-fighting", and some more polishing, packaging and testing before updating the plugin with a - hopefully - nice animation support !

    I'll let you know when that's done (probably not before 2020 though 😉 ).

    Cheers,
    Loïc

    posted in Cinema 4D SDK •

    Latest posts made by sketchfab

    RE: Multiple animation import

    @kbar @m_adam Thanks for the help lads, the markers were already added thanks to Kent suggestion in his previous reply.

    Now the only things left are a little "GlTF-fighting", and some more polishing, packaging and testing before updating the plugin with a - hopefully - nice animation support !

    I'll let you know when that's done (probably not before 2020 though 😉 ).

    Cheers,
    Loïc

    posted in Cinema 4D SDK •
    RE: Multiple animation import

    Hi Lads !

    FYI, the solution of playing each animation one after the other gave satisfying results 👍

    A tricky part though was to take into account joints animated in one animation, but not in others, hence keeping keyframed values where unnecessary.
    The naive but effective solution to this problem was to force joints to their rest position in the animations in which they are not keyframed.

    Another "trick" was to offset the animation tracks by a small margin. If an animation ends at 5000ms for instance, we make the other one start at 5001ms. This allows for the "forced" keyframes to interpolate correctly and not mess up the whole animation (strange things started happening when setting multiple keyframes at the exact same time frame, probably an undefined behavior...).

    For the "reference wolf", here is what the result looks like with an exaggerated margin between the animations is set to 1s (in practice, turning this value to something very small makes the transition immediate):

    Wolf gif

    Anyway, thanks @kbar and @m_adam for your suggestions, this case is solved !

    Cheers,
    Loïc.

    posted in Cinema 4D SDK •
    RE: Multiple animation import

    @m_adam Hi, and thanks for your feedback and suggestions.

    The Take System sounds like requiring too much user interaction after the import, and I think we won't therefore consider it/
    The motion system and "global" Python Tag seem like coherent alternatives to loading every animation one after the other.

    Now, the last step is to choose one of those systems...
    I think we'll first implement the back to back loading of animations as suggested by @kbar, as this seems like the most lightweight and straightforward solution for a quick iteration.

    Cheers,
    Loïc.

    posted in Cinema 4D SDK •
    RE: Multiple animation import

    @kbar Hi Kent, and thanks for your comment and constructive feedback !

    It's good to know that Motion Clips are hidden from the APIs, thanks for the confirmation on that subject.

    Your back-to-back suggestion definitely makes sense.
    Although it adds a little burden from the user perspective, it might still be the best approach to keep things "understandable", and has the advantage of not being too complex to implement, hence reducing the possible mistakes on our end 👍

    I'd definitely be curious about other suggestions/ideas too !

    Thanks again,
    Loïc.

    posted in Cinema 4D SDK •
    Multiple animation import

    Hi,

    We have made some progress to get our plugin working for C4D R20/R21, allowing import and export functionalities to Sketchfab (if you are curious, here is the latest version of the plugin, please note that you'll need an account on Sketchfab in order to download/upload files from/to the platform).

    We are now working on implementing support for the import of animated skinned objects, and... well... problems arise 😄

    How the import works

    Basically, we allow users to gain access to our library of downloadable models. The plugin allows to browse for models in a way similar to the website, and once authentificated, to import models through the GlTF format.

    In the latest release, we manage to correctly import the majority of the available files, although some of the materials can look different (due to the PBR material system we use on Sketchfab, and that is well translated in GlTF but not natively supported in Cinema4D).

    The problem

    This model makes for a perfect typical example: Wolf with Animations by user 3DHaupt (available under CC Attribution-NonCommercial-ShareAlike).
    As you can see on the 3D viewer or on the picture below, the wolf character has multiple animation "tracks" attached to it: Run, Walk, Idle...

    Screenshot (31).jpg

    As you can see on the screenshot below, importing the model works fine: we managed to import the joints and create the skeleton hierarchy, as well as skin the mesh with c4d.modules.character.CAWeightTag and OSkin objects (created under each skinned mesh).

    Importing only ONE animation from GlTF also works fine by parsing the keyframes and adding them to the F-curves of newly generated CTracks. So far, so good, we have a running wolf !

    Screenshot (32).jpg

    However, not being very familiar with Cinema4D ourselves (as users as well as using the API), we don't (yet) know how to import MORE THAN ONE animation in Python, in a way that makes sense to C4D users 😦 ...

    Things we tried / think about

    • We've explored using the Take system (for each different animation, create one Take, add it under the Main take, set it as the current take, and then parse in the keyframes/curves).
      But the final result seems to just be a mess of all the different keyframes combined, and except if we did something wrong, this system does not seem to be appropriate for what we are looking to achieve...
    • The motion clip system seems to be the standard and more appropriate for this "character" use case (generate one clip for each different animation, and let the user combine, separate or merge them as pleased), but we can't find any way to implement this through the Python API...
    • Another idea is to emulate the tutorials we find about Mixamo import (for instance here), and basically import the same geometry multiple times, but the workflow does not seem intuitive and feels like overkill given that we already have all the animation data in one file. Plus the motion clip system is still a mystery.
    • Finally, a last thing that people seem to do is to import each animation in a different C4D document, but once again, this seems far from the ideal workflow.

    Help ?

    Keeping in mind that we are far from being C4D experts, we are looking for any hint to implement the correct workflow to import multiple animations.
    Should we use the Take System, Motion Clips, CMotion ?
    And if so, how can we use them in Python ?

    Any help, code example, documentation, advice, or even further question concerning the issues we face would be, of course, warmly welcomed. Thanks in advance ! 😃

    Cheers,
    Loïc from Sketchfab.

    posted in Cinema 4D SDK •
    Tangent space, point clouds and multi UV materials

    Hi,

    We are currently working on a plugin to import glTF models from our platform into Cinema4D (using Python on C4D R20 Windows at the moment) and there are some details that we are still missing.

    For the following points, we are not sure if it's even possible in Cinema4D or with the current python API, but if it's the case, we are interested by any reference or example you might have:

    1. Setting tangents space data into a PolygonObject

    There is a TangentTag available but I didn't find any example or detail about how the data is structured, and also if this tag's purpose is actually to store tangent space data for normal mapping.
    Also, I get an error popup mentionning "Tag 5617 not in sync" when I add it to an object.
    (I read a bit about ddu and ddv properties in BaseShader but it doesn't seem to be the way to go)

    1. Creating a Point cloud object from script

    A PointObject class is available but the API doesn't allow any instanciation of such object. Some existing scripts seem to create point cloud from Polygon objects but it's not clear if it's actually possible and also if it's the right way to go.

    1. Multi UVS support in a single material

    Some of our models are using several layers of UVs data for a given material, where for example the Diffuse texture uses UV0 and AO uses UV1 (which covers the whole scene with a single texture). Is it actually possible in Cinema4D ?
    I was thinking about using layered materials to achieve this but even if it gives the right result, it would need material duplication and it's not really something we want to do.

    Anything about any of these topics will be a great help, thanks a lot for your time.
    Aurélien

    posted in Cinema 4D SDK •