Update 1st of May 2016
There appears to be bug in the Blembic importer and newer versions can not import Blembic files exported from 3ds Max. I will fix this as soon as possible but until then here is an older versoin of Blembic which is able to import cache files from 3ds Max:
BlembicImporter0_9_MAX.zip (4.31 KB)
Update 15th of March 2016
- updated the Houdini Exporter and the Blender Importer
- The Houdini Exporter now supports uv-Maps and Vertex Colors - please read the sticky note in the Houdini file
- Updated the Importers UI. Note that the “Mat” checkbox is not functional at the moment
- Updated Instructions below
Blembic.zip (165 KB)
Update 14th of March 2016
I started to write an exporter for Houdini and updated the importer.
The Houdini exporter so far supports.
- Vertices and Faces
- Split Normals
The importer has been updated and you can now:
- turn objects on and off in the viewport
- turn Split Normals on and off
- turn on y-up for objects that were imported from 3D programms that use Y as up Axis.
- The importers code is now documented better
A big thank you to Tiaan, Gerbrand and Mandrake for the help
Update 7th of March 2016:
I created a documentation of the Blembic file format on my web site. If you are interested in writing an exporter for another program this site explains how to set it up.
http://polykraft.de/wordpress/category/scripts/
Original post
Hi,
Blembic is an Addon which allows Blender to stream mesh caches exported from other 3D programs. I wrote it to bridge the gap until Blender has Alembic support, hence the silly name.
It uses it�s own binary format (.BBC) so it is faster than streaming files like obj or fbx caches.
This Addon is still in development so you probably want to be careful when using it in production.
Here is a video of a Particlesystem I made in 3ds Max, exported to Blembic cache and streamed into Blender.
Note: What you see is one single object that changes its mesh each frame.
Blembic so far supports:
- Geometry with varying vertex count
- Split Normals
- Material IDs for Multimaterial support (only from 3ds Max)
- UVW maps (currently only 1 channel)
- Vertex Colors (only from Houdini)
- You can have more than one Blembic object in your scene
It is pretty fast and uses very little ram even for objects with a very large vertex count.
I also wrote an exporter for 3ds Max and Houdini.
Note that the 3ds Max exporter can be rather slow for more complex objects. I have some ideas to improve that in the future.
Instructions:
Exporting 3ds Max
The exporter doesn�t have many options and is easy to understand:
- Start the exporter by going to: Scripting -> run script and Select the file "BlembicExport0_2.ms
- The exporter pops up
- Press the “Select Path and Filename” button (don�t input the folder manually. That is buggy at the moment)
- Your Object needs at least one Material or else the file will cause errors later on in Blender
- Set a frame range with the “start” and “end” spinners.
- Select the object you want to export
- If your object is a Particle System you have to apply a Mesher Object to it from the “Compound Objects” and select the Mesher object
- Hit Export
- If something doesn�t work you might have to close the exporter and start it again via Scripting -> run script
Exporting Houdini
- There is a Houdini file included in the download.- A sticky note in the file has some more information
- In the file you can see geometry piped into a node marked in the following image. Pipe your geometry into that. Note that only polygon meshes work. Things like poly soup or surfaces have to be converted to polygons first
- Set an output folder in the script. The folder has to exist and is not created automatically by the exporter
- Play the animation
Importing
-
Install the addon by going to the User Preferences in Blender -> Add-ons -> Install from File and select the file BlembicExporter.py
-
In the search field of the Prefernces search for Blembic and turn the Blembic Importer on
-
Create a cube Object or any other kind of mesh object
-
Select the Object and go to the Object Panel
-
Here you see the Addon. With the object active hit the “Add Object” button.
-
The object is added to the list. In the list you can now choose the folder you previously exported the mesh cache to.
-
The mesh cache is now imported. If you scrub the time line within the range of the cache the mesh will be updated.
-
To remove an object select it in the Blembic list (not in the viewport) and hit the “Remove Object” button.
-
If you rename your object in the scene you will have to select the object in the viewport AND in the Blembic List and hit the “Update Object” button
Adding Materials
Due to the nature of how materials are saved in Blender materials require a short workaround.
- Create a new cube. This cube is only there to store the materials so we�ll call it Material Cube
- Create as many Materials on this Cube as your Object in 3ds Max has MatIDs. Or assign one Material if you have exported from Houdini.
- With the Material Cube active hit the “Add Materials” button in the Blembic Addon
- Scrub the time line to update the materials.
- You probably want to turn the Material Cube to not renderable
There are several checkboxes in the importer. These checkboxes turn certain things on and off so you can increase the speed if you are currently not working with a certain Blembic object. Note that these changes are visible only after changin the timeline.
- On/Off turns the whole object off. It is not turned invisible it just stops animating
- Normals turns split normals on and off. This increases speed but turns the whole mesh facetted
- Y-Up flips the face normals. This is usually necessary for objects from Houdini. Note that you still have to rotate the object by 90 degrees manually
- Mat does not work at the moment and is there only for development purposes.
Future development:
- Options to turn off materials, uv-maps and vertex colors for faster streaming
- Vertex colors for 3ds Max
- faster exporter
- perhaps an option to import ngons. This would make it possible to stream low poly objects and apply a subdivision modifier in Blender. This would require a lot of code to be rewritten, though and seems to be rather complicated.
- Check if it is possible to turn the whole exporter node setup into a single VEX node that pipes the information into the Python exporter directly.