Coder Social home page Coder Social logo

archilogic-com / data3d-blender-io Goto Github PK

View Code? Open in Web Editor NEW
16.0 16.0 4.0 1.44 MB

Blender exporter for data3d - a binary format optimized for webGL.

Home Page: http://3d.io

Python 100.00%
3d-models 3dio aframe blender blender-addon blender-scripts blender3d data3d python threejs webgl

data3d-blender-io's People

Contributors

jagvisual avatar mredele avatar tomas-polach avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

data3d-blender-io's Issues

Collada export not working for some 3dio furniture pieces

Reproduce:

I made a small gist here that you can run on node.js to reproduce the problem: https://gist.github.com/bnjm/9ab98822642337346b5d77b70786b6d0

But you can also reproduce with this snippet:

io3d.storage
  .exportDae(
    '/535e624259ee6b0200000484/2017-11-23_21-53_p1lBYj/2017-11-23_21-53-53_pP2nc8.gz.data3d.buffer',
  )
  .then(io3d.utils.processing.whenDone)
  .then(console.log)

Result:

Exported .dae file cannot be opened by xcode or blender. Outputted collada file is here: https://gist.github.com/bnjm/571438f577ed6f2e1f8c0eaf7560fdd6

Additional info:

  • textures are loaded correctly
  • obj export works correctly for the same piece

We think there are other furniture pieces affected and will these to the gist after some more testing

Add Documentation for blender add-on and code

We need documentation for 3d artists

  • installation
  • features and options
  • use from command line

And documentation for the code for contributors

  • design and structure of the add-on
  • documentation of code

Colors from buffer are ignored

Reproduce:

export the following chairs which both have different color materials
https://furniture.3d.io/#furnitureId=51734d5c-9b44-4e05-8991-2534a8707511
https://furniture.3d.io/#furnitureId=91a18c8a-f414-4aed-8a8f-b1c71549e214

io3d.furniture
  .get('51734d5c-9b44-4e05-8991-2534a8707511')
  .then(x => x.info.data3dStorageId)
  .then(io3d.storage.exportDae)
  .then(io3d.utils.processing.whenDone)
  .then(x => console.log('should be black': x))

io3d.furniture
  .get('91a18c8a-f414-4aed-8a8f-b1c71549e214')
  .then(x => x.info.data3dStorageId)
  .then(io3d.storage.exportDae)
  .then(io3d.utils.processing.whenDone)
  .then(x => console.log('should be red:', x)

Result:

Both are grey

screen shot 2017-12-14 at 11 20 22

Weird normals

reproduce:

  1. export the yellow couch as data3d buffer from https://spaces.archilogic.com/model/archilogic/ezl15mqb?modelResourceId=f7a3e584-374a-4647-93ba-aa0bd56574df&mode=edit&view-menu=none&main-menu=save&logo=false
  2. import data3d buffer in blender using import plugin

result:

normals look distorted.
blender

note:

the gray couch is a copy of the yellow one where textures have been deleted. importing only the gray couch into blender will result in normals looking correct:
blender

files for convenience:
gray_couch.zip
yellow_couch.zip

Scale and rotation property from buffer is ignored

The furniture piece Tabano (productResourceId: 0b35a7a1-1251-4652-bfdb-62375558db99) displays ok in archilogic and a-frame, but when exported is at the wrong scale

Steps to reproduce:

io3d.furniture
  .get('0b35a7a1-1251-4652-bfdb-62375558db99')
  .then(x => x.info.data3dStorageId)
  .then(io3d.storage.exportDae)
  .then(io3d.utils.processing.whenDone)
  .then(console.log)
// 535e624259ee6b0200000484/processing/2017-11-28_17-34-19_OBcHg4/2017-11-23_22-27-15_HVGQBc.zip
// => open file in 3d editor

screen shot 2017-11-28 at 18 41 45

The result is the same with io3d.storage.exportObj leading to it being an issue with the importer.

Here's the buffer file:
https://spaces.archilogic.com/3d/template/new?file=/535e624259ee6b0200000484/2017-11-23_22-27_9kuARm/2017-11-23_22-27-15_HVGQBc.gz.data3d.buffer&mode=sdk

Prepare repository to go public & publish

Data3d IO will be an open source addon

  • Wiki pages with documentation & usage (checkout PYdocs for automated documentation)
  • Wiki design&workflow // version number
  • Remove redundant code
  • Create Issues for known bugs and missing features

(...)

Umbrella issues for data3d Addon tasks / bugs

Open issues - ** transfered from https://github.com/archilogic-com/services/issues/41**

WIP

Import

  • Clean Mesh & use_image_search optional @(low priority)@
  • Do we have object-specific metadata (-> check with tomas about visibility attribute)?
  • clean mesh / clean hierarchy > improve performance (because of bpy.ops use)
  • Meshes with no uvs that are merged with meshes with uvs: handle unwrapping / disable merge / mark faces (now we generate additional, faulty uv data because of auto uvs when merging)
  • Option to disable coords distinct, remove doubles, tris to quads for previews
  • Reset logger config / remove global variables from addon (eg. the reference to the buffered file)
  • Improve buffer import performance (parsing data is much slower then json parsing -> data3d importer issue
  • convert_tris_to_quads breaks normals

Export

  • if UV channel does not conform the name, take the channel by index (0 -> uvMap, 1-> uvLightmap else no UV)
  • Material Texture Scale for 3d artists
  • export hierarchy instead of flattened @(low priority)@ (only for data3d.json)
  • Apply world matrix from operator params or remove
  • export = import = client (sustainability)
  • Don't export uv's if uv area is 0
  • texture references to texture directory!

General

  • Implement material-cycles / cycles-blender converter service for 3d artists (with restrictions, and only for 3d artists) @(low priority)@
  • Implement toggle cycles-blender render- done
  • Implement a convert to cycles method for 3d artists

Document how to use from the command line

This plugin can be used without launching the Blender GUI straight from the command line.
That's useful for automated or otherwise scripted workflows.

There's no documentation for that yet, so let's change that ๐Ÿ’ฏ

Export fails if files are missing.

Add test to export_image_textures (line 76 in io_scene_data3d\export_data3d.py),
warn the user about the missing files and continue.

Path 'C:\Users\pascal-babey\AppData\Local\Temp\Temp1_archilogic_2017-05-16_15-47-58_R6dGyD.zip\archilogic_2017-05-16_15-47-58_TAZb6H\textures\40603630c72193e8d1d5f689b57e4cdc.source.jpg' not found
Traceback (most recent call last):
 File "C:\Program Files\Blender Foundation\Blender\2.78\scripts\addons\io_scene_data3d\export_data3d.py", line 311, in _write
   materials = parse_materials(export_objects, export_al_metadata, export_images, export_dir=os.path.dirname(output_path))
 File "C:\Program Files\Blender Foundation\Blender\2.78\scripts\addons\io_scene_data3d\export_data3d.py", line 76, in parse_materials
   export_image_textures(list(set(raw_images)), export_dir)
 File "C:\Program Files\Blender Foundation\Blender\2.78\scripts\addons\io_scene_data3d\export_data3d.py", line 62, in export_image_textures
   shutil.copy(filepath, os.path.join(tex_dir))
 File "C:\Program Files\Blender Foundation\Blender\2.78\python\lib\shutil.py", line 235, in copy
   copyfile(src, dst, follow_symlinks=follow_symlinks)
 File "C:\Program Files\Blender Foundation\Blender\2.78\python\lib\shutil.py", line 114, in copyfile
   with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: '\\..\\Map #3'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
 File "C:\Program Files\Blender Foundation\Blender\2.78\scripts\addons\io_scene_data3d\__init__.py", line 199, in execute
   return export_data3d.save(context, **keywords)
 File "C:\Program Files\Blender Foundation\Blender\2.78\scripts\addons\io_scene_data3d\export_data3d.py", line 352, in save
   export_al_metadata=args['export_al_metadata'])
 File "C:\Program Files\Blender Foundation\Blender\2.78\scripts\addons\io_scene_data3d\export_data3d.py", line 327, in _write
   raise Exception('Export Scene failed. ', sys.exc_info())
Exception: ('Export Scene failed. ', (<class 'FileNotFoundError'>, FileNotFoundError(2, 'No such file or directory'), <traceback object at 0x000001E507D6F208>))

location: <unknown location>:-1

import into blender breaks some lightmap UV coordinates (barcode)

2017-08-16 01_11_28-blender_ c__users_vagrant_desktop_testscene blend
the UV faces on the left are wrong, they are dragged across the whole texture

import_uvs_bug

imported data3d file, blender scene with result

by process of elimination we assume the problem happens in the importer

Note:
This problem occurs when downloading baked archilogic scenes and importing them with the addon. We did not see the problem not happen with the first UV channel, only with the second channel (lightmapUvs)
A lead to find the source of this is to determine what is the difference between these two channels.

Document the features and options

Right now the getting started documentation is lacking proper documentation on:

  • What this plugin allows you to do with it
  • How that works

You can use the headlines to fill in missing information, but basically:

  • Importing a model
  • Exporting a model
  • Toggling the engine

If you want to work on this but aren't sure how to get going, comment here and mention me or @Aadjou for details ๐Ÿ‘

Add feature to convert blender internal materials to cycles and back

Use Case:
A user downloads an Archilogic model as a blend file and wants to manipulate the materials in cycles.
When exporting the file as a .obj file to import the model back into Archilogic, the materials are exported from blender internal and the changes in cycles are not taken into account.

Suggestion:
Add a feature to convert material information of an Archilogic blend file from cycles to blender internal (and back) to make sure that you don't lose material information such as assigned textures when trying to export the model to a format like OBJ.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.