Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension as a Blender addon #94

Open
vvoovv opened this issue Apr 26, 2018 · 3 comments
Open

Extension as a Blender addon #94

vvoovv opened this issue Apr 26, 2018 · 3 comments

Comments

@vvoovv
Copy link
Owner

@vvoovv vvoovv commented Apr 26, 2018

Here we describe and discuss how to extend the blender-osm addon via a separate Blender addon (i.e. an addon for the blender-osm addon).

General notes

There are a number of scenarios how blender-osm and an extension can interact.

blender-osm is the master, extension is the slave

blender-osm serves as the master addon, the extesion serves as the slave addon.
The extension registers some objects (functions, classes, instances of class, etc) in the bpy namespace. The blender-osm addon checks if the bpy namespace contains the agreed stuff and performs the agreed actions with it.

blender-osm is the slave, extension is the master.

Example: OpenStreetMap 3D editor for Blender. Currently only the export from Blender to an OpenStreetMap has been done. Additional work is needed based on the NP Station to provide creating a simple 3D building for OSM in Blender.

Here the OSM editor simply imports the blender-osm modules responsible for creating specific roof shapes.

Extension provides a well known functionality

The extension provides a well known functionality which isn't specific for the blender-osm addon.
Example: custom map projections being developed by @JeremyBYU. All Blender addons dealing with geographic data, can benefit from that extension. Among those addons are blender-gpx and blender-terrain.

Here the blender-osm (or another addon) checks if the addon for the custom map projections is installed and activated (?). If yes, the master addon imports the required stuff from the extension. The master addon must be aware of the module, class and function names in the extension.

@JeremyBYU

This comment has been minimized.

Copy link

@JeremyBYU JeremyBYU commented Apr 27, 2018

Sounds great. I think the extension as a slave will work best. Look forward to working on it with you!

@vvoovv

This comment has been minimized.

Copy link
Owner Author

@vvoovv vvoovv commented Apr 28, 2018

Another idea for extension detection:

Scan all activated addons and check if the addon exposes a specific variable in __init__.py, for instance:
blender_osm_extension = True

There is no need to set anything in the bpy namespace.

@vvoovv

This comment has been minimized.

Copy link
Owner Author

@vvoovv vvoovv commented May 10, 2018

Integration with bpyproj is finished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.