EskelCz / Cinema4D-Threejs-Exporter

Exporter for Cinema 4D to JSON format usable in Three.js
MIT License
218 stars 22 forks source link

Material support #3

Closed sasha240100 closed 7 years ago

sasha240100 commented 7 years ago

Any plans on making of materials export support?

EskelCz commented 7 years ago

Unfortunately not. I'm not as active with Three.js as I used to be, so I guess someone else has to carry the torch forward. Sorry

sasha240100 commented 7 years ago

Maybe we can. Can you at least point is where to look in your code and where to start from?

On Mar 6, 2017 8:32 PM, "David Spohr" notifications@github.com wrote:

Unfortunately not. I'm not as active with Three.js as I used to be, so I guess someone else has to carry the torch forward. Sorry

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/BlackDice/Cinema4D-Threejs-Exporter/issues/3#issuecomment-284487711, or mute the thread https://github.com/notifications/unsubscribe-auth/AHTX1davhXIaekvae55EyC485xNOCh0Kks5rjFFUgaJpZM4MSU-u .

EskelCz commented 7 years ago

It's similar to all the other types of data. In exporter.py try to get materials from base document with this function: https://developers.maxon.net/docs/Cinema4DPythonSDK/html/modules/c4d.documents/BaseDocument/index.html?highlight=materials#BaseDocument.GetMaterials Here is the reference for the C4D material: https://developers.maxon.net/docs/Cinema4DPythonSDK/html/modules/c4d/C4DAtom/GeListNode/BaseList2D/BaseMaterial/Material/index.html?highlight=material Not sure if it has all the data that would be needed.

Then you have to figure out which materials are active on the mesh, probably by tags on the active object. https://developers.maxon.net/docs/Cinema4DPythonSDK/html/modules/c4d/C4DAtom/GeListNode/BaseList2D/BaseObject/index.html?highlight=object#BaseObject.GetTags

Then you have to figure out how to parse the data to json into values that three.js understands. If you can make that happen, I can probably find some time to do the UI work to finish it off.