-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for importing library animation clips #565
Comments
is it possible to take a look at your importer code ? |
yes of course. However it is a bit of a large blob and it took me quiet a while to find my way through it ;/ https://developer.blender.org/diffusion/B/browse/master/source/blender/collada/DocumentImporter.cpp Here is a bit of a roadmap in the hope it helps to quickly identify what we are doing wrong here: First of all check the parameter mImportStage in the DocumentImporter. That parameter is preset to General when the importer is created. So when we get to the point of interest further down you can expect this is true:
Ok... As far as i can see the main entries of interest in DocumentImporter are: The method writeAnimation() seems to be called for Animation entries, but only if the animations contain sources, channel and sampler. Organizational animation nodes seem to be not reported to the importer? writeAnimationList() in line 1334 From the method name writeAnimationList() i expected to get the animation clips here. But the bindings in the animationlists that i get here actually point to the same animations that i already have imported before when writeAnimation() was called. The animation clips still hide somewhere... So i need to understand where and how animationclips are imported. For clarity i also uploaded a small testfile suzanne.dae to our Blog There you find 3 library animations and one animation_clip that refers to 2 of the library animations. I expect that the animation "Suzanne_SuzanneAction_location" is passed to writeAnimation() so i can import it to the scene for direct playback. And i expect the animation clip "SuzanneAction" is passed to writeAnimationList() so i can add the animations mentioned in the clip to the animation library in Blender. Since i get all animations in both methods and no information about the animation clips at all, i believe that i misunderstand something here. |
From our investigation it does not look like openCollada has support to read clips :-( |
So changes to openCollada are required. |
Do you think this can be done easily? I am also not sure if i can be helpful on the OpenCollada side, but if it is doable without knowing the entire collada sources, then i can give it a try later. However i would appreciate if someone more familiar with the library could take care of this if possible ? thanks :) |
Ideally someone who is familiar with the OpenCollada sources should do this. But if nobody is available, then i can give it a try. In that case can i expect to get some help from here? At least some hints or pointers to something that i can look at as an example for how to add this feature? Thanks for any response on that :) |
I just had the idea if there is a more direct access to the collada file. So that i can for example get a list of all "library_animation_clips" nodes. Then i can step into this node list and figure out which instance_animations are listed. This gives me the information which animations are meant to be imported to the scene, and which are meant to be imported into the animation library. If this is possible then its ok for the begin :) |
Bump, we need this for COLLADA2GLTF also: KhronosGroup/COLLADA2GLTF#130 |
@gaiaclary, I have opened up #592 which adds support for animation clips to OpenCOLLADA. If you could try it and see if it has any issues for you, I would appreciate that. |
@lasalvavida Sorry, i must have overlooked your post from october. But i am glad to see that this issue has been resolved now. So i will add it to the Blender 2.8 development branch in the next days. |
Hi;
I am trying to add support for library animation clips to the Blender Collada Importer. The problem is that according to the specification animations shall only be applied to the scene animation playback when they are not referenced by any library animation clip:
From the Collada 1.4 Spec document:
However during import i just get the defined instance_animations one after the other and i can not figure out which of them i shall import as library animation and which of them i shall import directly to the scene playback.
Any Help? Any example function where i can look at?
btw: Exporting libary animation clips was no problem with OpenCollada.
The text was updated successfully, but these errors were encountered: