Export animations from cinema4d to blender - three.js

I've been trying to get some animated models from c4d into Blender all day. The models transfer fine, but the animations don't. I've used COLLADA, 3ds and obj file types but none are successful.
I need to get the files into Blender as I'm trying to get them into three.js. I have had a look at http://disturbmedia.com/blog/tag/threejs/ for c4d>threejs but the python console is throwing up errors.
Does anyone have any thoughts?
I'm using v12 of c4d and v2.59 of blender if that's any help.

I was facing a similar issue a couple of years ago, as you can see in this answer
and I ended up writing a Python script.
The post from the blog at work on three.js was also written by me and is also old.
It was written for C4D R11.5 and the API changed a bit. Vincent was kind enough to branch from my GitHub repository and update that script, which you can get from his repository.
Still the three.js script only exports geometry/meshes, but doesn't handle animation at all (morphing was not supported in three.js at the time I wrote the script (release 32))
If you want to export geometry+animation tracks(position,rotation,scale,and morphs(PLA)), you might something like an updated version of the script I had. Since it's almost two years old, it works for C4D R11.5 and Blender 2.49.
You can see a recording of how it worked here.
Still, as I mentioned above, the C4D R12 Python API changed a bit and the Blender Python API changed completely as they went for Python 3.0 from Blender 2.50 upwards.
Unfortunately, I can't commit to updating that soon due to time constraints, but I can explain/comment/share the old code if it helps.
Another thing that comes to mind is to use the older versions(C4D R11.5 and Blender 2.49), but it seems like a long way around it and maybe not all the features you use in R12 are supported in R11.5 (not sure).

Related

Assimp doesn't read weights for specific bone of a mesh from .dae or .fbx file

I am having a problem with importing animated model (.dae or .fbx). In debug mode on the picture below, assimp doesn't load weights for specific bone. I tried for 3 different models and error is the same.
This is the last model I tried. If you could help me, I would be very thankful!
screenshot of a debug mode
I've just found where was the error. If there is someone, with the same problem, this post might help you.
I solved the problem by deleting assimp (I am not sure which version was that, but I cloned the repo from github a few months ago), and then I added newer version. After that I don't have a problem mentioned in my previous post. Now mWeights in mBones is populated with data, compared to screenshot I left in the question above.

Download multiple files from a website instantly

There is this website called Texture Haven, which has a lot of free textures to use for blender, only problem is it takes a lot of work to download them all manually.
So my question is: Would there be a way to download them all instantly with some kind of script?
Texture Haven: https://texturehaven.com/textures/
Have you tried looking for web-downloaders with Python? I'm not sure if it will work but you can try some of these:
1. https://www.geeksforgeeks.org/downloading-files-web-using-python/
2. https://pypi.org/project/pywebcopy/
3. https://www.codementor.io/aviaryan/downloading-files-from-urls-in-python-77q3bs0un
Let me know if this works out for you. Otherwise you'll just have to manually download the packages. You could also try out other websites for blender textures like:
https://texture.ninja/ not sure if you can install entire packages at once but it's fairly easy to install lot's of textures.
You could also look for some add-ons for blender like https://www.blenderkit.com/
I hope this works out for you and happy blending!
Edit: format

Three.js Typeface.js offline

the problem is obvious from the title, http://typeface.neocracy.org offline. It was used to convert fonts and used in conjunction with THREE.TextGeometry. But if it is offline, how is now possible to use custom fonts in three.js?
I made a new converter that outputs the same files as typeface.js.
http://gero3.github.io/facetype.js/
I loaded the source, but as far as I can see there is no chance to create the JS-font-files with this distribution. Maybe for someone with deep perl-knowledge...? In any case I installed perl, the ppm and dmake but trying to exec the Makefile only leads to errormessages about missing files. No - this is no alternative to the online-converter. Even worser: I didn't find any other converter or another side using the same one (cufon seems to create another format). So let's hope the site comes back to live - otherwise the great textfeature of three.js is worth nothing in the moment.

THREE.js seems to not work on localhost server

I am just starting out with THREE and have come across some odd failures which I believe are due to localhost / same-origin-poicy.
In short I created my own animation using armatures in Blender and exported using the three.js exporter plugin. The model displays but the animation doesn't run.
I used the online skinning animation example as the basis for the code and thought I may have incorrectly stripped out certain code that was causing it to fail but after looking for a couple of hours I have come to the conclusion I haven't ripped out anything incorrectly so...
To test if the example code worked locally I copied the online skinning animation example code including the buffalo.js/png files, modified the file references to map to my local copy and tried to run it in a local IIS server and all I get is the stats and no animation or model.
I checked the firebug console and only had a coupe of depreciation warnings no errors. I also checked with my model and code and I get no errors or warnings...
Anyone had this experience before? (I tested in chrome/firefox both had same behaviour)
Am happy to post code but the JSONLoader(ed) model is massive.
Thanks (and sorry for the long windedness of this SO question)
When it comes to running things on your local machine, have you tried the steps on this wiki page? How to run things locally
One example on the page suggests: chrome --allow-file-access-from-files
It's possible that your issue is related to the steps taken during your export. Without the exact errors or screenshots it's difficult to know where the issue originates from. Things to look out for:
Is your model being exported at the first frame?
Do you have the latest .py export plugin for Blender?
Using the latest version of Three.js?
Tried using THREE.SkinnedMesh?
Here is an article that gives you a brief overview of what is required for animated meshes within Three.js: Skeletal Animation
This second article provides a much more detailed tutorial, complete with example code at the bottom of the page: Skeletal Animation +1
In order to rule out same origin policy you can actually disable the security checks chrome uses when it starts up by adding this to the target window on your shortcut properties
--disable-web-security
see here for more information : Disable same origin policy in Chrome

KineticJS-saveImagedata() , Problems updating to new kineticjs library

I used kinetic-v3.10.4.js for almost all my work.
Now the requirement changed and I need to add few more functionality that are available in newer versions.
So I started using kinetic-v4.0.1.js.
I made a sample file and it is working fine but few functions like saveImageData();,DetectionType.etc. are not working in 4.0.1 as they have been updated and instead of saveImageData(), createBufferImage() is the new function.
I am redoing everything with kinetic v4.0.1 now.
I can't find the old example in the website that was using createBufferImage() for image event detection as it has been updated to 4.3.3
So anyone having any old example that help in pixel detection/image detection with 4.0.1
How about searching from archived internet contents, archive.org
http://web.archive.org/web/*/http://html5canvastutorials.com

Resources