OSArch Community

Sharing core functionality instead of disparate implementations across Blender addons

  1. M

    @nikitron yes :) Let's totally do that too! Can you think of any complications or is it straightforward?

  2. M

    @stephen_l - I don't think we agreed on who would build this "add-on to install add-ons", but you seemed quite experienced in this, would it be possible for you to build this?

    @kcress - how close are you to providing a method that I can call to get the coordinates of start/end dimensions? I think once that function is available, most of my code can be ripped out.

  3. S

    Will take a closer look at "Merlin's" last year GSOC work as he should handle such thing and probably more (asset download), alternative is a huge refactor of CGCookie updater to handle multiple add-ons at once.

  4. S

    About import across add-ons

    Make dynamic import at run time so cross import will not end up in dependency hell

    
    def xxx(y):
    
        # inside the body of your func
    
        from addon_name.file_name import class_or_function
    
    
    HAS_BLENDERBIM = False
    
    def include_blenderbim():
    
        try:
    
            from blenderbim.bim.export_ifc import (
    
                IfcParser,
    
                IfcExporter,
    
                IfcExportSettings,
    
                QtoCalculator
    
            )
    
            logger.info("found blenderBIM addon")
    
           HAS_BLENDERBIM = True
    
        except ImportError as ex:
    
            logger.info("BlenderBIM addon not found %s" % ex)
    
            print("BlenderBIM addon not found %s" % ex) 
    
  5. K

    @Moult I should be able to have a function like that up and running by this weekend.

  6. K

    @Moult whats the best output/return type for your purposes? I could write this as an operator that generates curve objects for each dimension, similar to what BlenderBIM does now, or it could just be a simple function that returns a list of co-ordinate pairs? Whichever works best for you!

  7. M

    @kcress no need for geometry, coordinates are good enough :) coordinates should be global, which I will then project onto the camera view.

    Either coordinates pairs, or if you handle a "dimension string" as a list, I can handle that too. Keep in mind the coordinate order matters, since that determines which side the dimension numbers appear. The distance between coordinates must be the same as the dimension number.

  8. K

    @Moult Sorry just getting around to writing this tonight. It's committed to the master branch now so you should be able to test it out, the function 'blenderBIM_get_coords(context)' is in a new file called 'measureit_arch_external_utils.py', it returns a list each dimensions co-ordinate pairs like this '[[[-1.0, -1.0, 1.0], [-1.0, 1.0, 1.0]], [[-1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]]' pairs are always ordered smallest to largest along the dominant axis of the dimension. Let me know if works, or if I need to make any changes to the sorting!

    Right now it's only implimented for MeasureIt-ARCH's aligned dimensions, but it should be fairly straightforward to create a function for annotations and other dimension types once we know this is working.

  9. S

    MeasureIt Arch compatibility will land in archipack 2.3.1

    Get best of both worlds, manipulable with real time update, single click to add "measured points", global style.

  10. C

    @stephen_l said:

    MeasureIt Arch compatibility will land in archipack 2.3.1

    Get best of both worlds, manipulable with real time update, single click to add "measured points", global style.

    Cool!, will there be integration with BlenderBIM?

  1. Page 1
  2. 2

Login or Register to reply.