Comments (24)
Sounds like a good idea! I'd much rather have Banbury lead, as I still can't quite wrap my head around this thing. (Python's lack of static types can actually be a pain at times)
from ldr-importer.
I have no plans to rewrite the importer for the time being, since it works well enough for me. Currently I'm playing with the new 2D features of Unity3D.
If you want to rewrite it, I'll be happy to help by reviewing the code and testing. But you'll have to do the main part of the work.
As a starting point I would suggest to move the parsing of the DAT files into its own class. The data could be stored in a dictionary. A second class would then take this dictionary and build a model from it. That would make the whole thing much easier to read. The whole material stuff could also have its own class. The script is already getting rather large. So splitting it into multiple files would also be a good idea.
from ldr-importer.
Well in that case, I'll try doing what you said as soon as I get a few more core features implemented in https://github.com/Tribex/RapidS
from ldr-importer.
Alright, sounds like a plan! Banbury, will you make a diagram of what you suggested on the wiki? That will help us when we are coding. 😉
That's fine, Tribex. I probably won't start working on it this week either (Christmas is this week after all), but I will go ahead and make the branch for the changes and update the aforementioned issues for the v1.3 milestone.
from ldr-importer.
Umm, no? I don't want to be a dick here, but drawing diagrams is what I'm doing at work and currently I'm on vacation.
from ldr-importer.
@le717 I'll attempt to make a diagram, if I can understand it. Just finished the last major thing for RapidS 0.1. (Documentation) >_>
Where is the wiki document? I can probably find it.
from ldr-importer.
@Banbury No no, I understand. I wouldn't want to do what I do every day for work on vacation either. It's all good. 😉
@tribex Right under the pull request button at the right of the page is a book icon. That is the wiki. It can also be accessed from https://github.com/le717/LDR-Importer/wiki. Put it somewhere under Developer Area.
The script is already getting rather large. So splitting it into multiple files would also be a good idea.
Good idea, but not completely possible. Blender has a requirement that all addons have an bl_info
dictionary, and without one it throws (harmless, but possibly scary) error messages. In addition, they have no directive or way to get around this requirement. Blender itself has to be changed to allow this. Yes, it would ideally be broken up into multiple scripts, but we simply can't (and because all addons must be in the root addons
folder, and will not detect them in subfolders, requiring yet another Blender change. >_<).
from ldr-importer.
@le717 I'll try to come up with a good system/diagram, currently down with a cold.
We could do multiple files the same way as we do the configuration. With fake includes.
from ldr-importer.
It's perfectly possible to split the script into multiple files and/or packages. The Blender way to do this is to move the bl_info into the _init.py.
Please see here how to create a package in Python. You can also have a look at the addons in Blender (/2.69/scripts/addons) for examples.
from ldr-importer.
Before I forget. Please create a new branch for the rewrite. This will be a lot of work and maybe we still want to do fixes for the old version, before the new version is ready.
from ldr-importer.
New branch already created. I had already thought of that when I created the issue. ;)
https://github.com/le717/LDR-Importer/tree/rewrite
:O Looks like I have some reading to do! Thanks! Although loading from sub folders would still be nice...
@tribex Oh no! D: Hope you feel better soon!
Merry Christmas, everyone. 😃
from ldr-importer.
Thanks :)
Merry Christmas! :D
from ldr-importer.
An example of why this is needed is in #39
from ldr-importer.
Don't worry Tribex, we have already firmly established reasons for the rewrite. 😉 I may have time to work on it soon, but we need that diagram first so we know how to proceed.
from ldr-importer.
RIght, but how do we make a diagram if we don't know how to proceed? I have a few ideas, but they're not very solid yet.
from ldr-importer.
Quote Banbury:
As a starting point I would suggest to move the parsing of the DAT files into its own class. The data could be stored in a dictionary. A second class would then take this dictionary and build a model from it. That would make the whole thing much easier to read. The whole material stuff could also have its own class. The script is already getting rather large. So splitting it into multiple files would also be a good idea.
Banbury, you want to add to this?
from ldr-importer.
Ah, okay. I'll hopefuly start this afternoon... Depending on how late I'm actually out.
from ldr-importer.
If I would do the rewrite, I would start by writing a generic LDraw parser class, that stores the whole model in some Python structure (either a dictionary or a class tree). Then I'd write a class that reads this data structure and creates a model from it. Basic enough. The devil is of course in the details 😄.
PS: I'm currently preparing the release of a Unity 3D addon. So I'm rather occupied right now.
from ldr-importer.
What does the addon do?
Also, no diagram today... And my schedule is unfortunately getting much busier for the foreseeable future. :C
from ldr-importer.
http://vimeo.com/82824100
https://github.com/Banbury/UnitySpritesAndBones
I'm not finished uploading yet. Any discussion should happen there.
from ldr-importer.
What exactly does that do to Unity? Make your desktop literally 3D?
BTW, vimeo is blocked in my country.
from ldr-importer.
I'm talking about Unity 3D, the game engine.
from ldr-importer.
Oh sorry, I thought you meant the Ubuntu Unity 3D.
from ldr-importer.
Simply making a note here.
@Anonymooseable just introduced me to this:
http://www.blender.org/documentation/blender_python_api_2_69_9/bpy.types.AddonPreferences.html
We might be able to use this for the preferences system instead.
from ldr-importer.
Related Issues (20)
- Install errors on OS X with version 1, 3, 0 HOT 5
- Missing LDraw Search Path on Linux HOT 2
- problem: 'cannot find c:/Ldraw' HOT 3
- ldr-importer does not import all lego blocks HOT 19
- Can't install 1.3.1 HOT 3
- Incorrect Normals / Broken Normals with some random parts/bricks HOT 2
- Unexpected normals when cleanup disabled HOT 1
- Model file contents too short to extract header HOT 7
- 1.3.2 doesn't work - back to 1.2.0 HOT 4
- Using LDR-Importer from python API HOT 2
- "Basic Cleanup" function corrupts LEGO logo in open studs HOT 3
- FBX export is not supporting Cycles nodes HOT 1
- Problem: cannot find Ldraw installation at c:\ HOT 1
- Path's reset of LDraw Parts Library
- Cannot Find LDraw Installation at C:/Ldraw HOT 4
- Doesn't load model
- LDD to LDR, missing pieces, moved pieces HOT 1
- LDD-Importer-Exporter for the future HOT 1
- I can't use this addon
- Traceback call issue HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ldr-importer.