3dio-js icon indicating copy to clipboard operation
3dio-js copied to clipboard

Decide on how to deal global material IDs (material API)

Open tomas-polach opened this issue 7 years ago • 1 comments

global material IDs are common in dynamic elements (aka parametric objects) in the scene structure in the editor (spaces.archilogic.com)

this is not a pressing issue since:

  • we do not yet support dynamic elements in our aframe components
  • when exporting data3d, global material IDs are being converted to full material attributes (means they are not present in data3d files)

the idea of global material IDs was to store them in database at some point and serve them via material API. (similar approach as with furniture)

tomas-polach avatar Oct 26 '17 11:10 tomas-polach

take a look at dynamic-entities branch https://github.com/archilogic-com/3dio-js/tree/dynamic-entities/src/aframe/component/dynamic-entities it has already support for library materials material definition follows implementation for io3d-furniture

<a-entity io3d-wall="h:2.4, l:3, material_front:bricks" position="2 0 -1" rotation="0 12 0"></a-entity>

support for custom materials could look like this:

  <a-assets>
     <a-asset-item id="my-mat" io3d-material="colorDiffuse: #fff; colorSpecular: #09f; mapDiffuse: texture1.jps"></a-asset-item>
  </a-assets>
<a-entity io3d-wall="h:2.4, l:3, material_front: #my-mat" position="2 0 -1" rotation="0 12 0"></a-entity>

frederic-schwarz avatar Oct 26 '17 11:10 frederic-schwarz