Code Monkey home page Code Monkey logo

Comments (24)

JoshTheDerf avatar JoshTheDerf commented on August 18, 2024

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.

Banbury avatar Banbury commented on August 18, 2024

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.

JoshTheDerf avatar JoshTheDerf commented on August 18, 2024

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.

le717 avatar le717 commented on August 18, 2024

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.

Banbury avatar Banbury commented on August 18, 2024

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.

JoshTheDerf avatar JoshTheDerf commented on August 18, 2024

@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.

le717 avatar le717 commented on August 18, 2024

@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.

JoshTheDerf avatar JoshTheDerf commented on August 18, 2024

@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.

Banbury avatar Banbury commented on August 18, 2024

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.

Banbury avatar Banbury commented on August 18, 2024

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.

le717 avatar le717 commented on August 18, 2024

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.

JoshTheDerf avatar JoshTheDerf commented on August 18, 2024

Thanks :)

Merry Christmas! :D

from ldr-importer.

JoshTheDerf avatar JoshTheDerf commented on August 18, 2024

An example of why this is needed is in #39

from ldr-importer.

le717 avatar le717 commented on August 18, 2024

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.

JoshTheDerf avatar JoshTheDerf commented on August 18, 2024

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.

le717 avatar le717 commented on August 18, 2024

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.

JoshTheDerf avatar JoshTheDerf commented on August 18, 2024

Ah, okay. I'll hopefuly start this afternoon... Depending on how late I'm actually out.

from ldr-importer.

Banbury avatar Banbury commented on August 18, 2024

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.

JoshTheDerf avatar JoshTheDerf commented on August 18, 2024

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.

Banbury avatar Banbury commented on August 18, 2024

http://vimeo.com/82824100
https://github.com/Banbury/UnitySpritesAndBones

I'm not finished uploading yet. Any discussion should happen there.

from ldr-importer.

JoshTheDerf avatar JoshTheDerf commented on August 18, 2024

What exactly does that do to Unity? Make your desktop literally 3D?

BTW, vimeo is blocked in my country.

from ldr-importer.

Banbury avatar Banbury commented on August 18, 2024

I'm talking about Unity 3D, the game engine.

from ldr-importer.

JoshTheDerf avatar JoshTheDerf commented on August 18, 2024

Oh sorry, I thought you meant the Ubuntu Unity 3D.

from ldr-importer.

le717 avatar le717 commented on August 18, 2024

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)

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.