Giter Site home page Giter Site logo

bonjorno7 / 3dn-bip Goto Github PK

View Code? Open in Web Editor NEW
55.0 4.0 3.0 1 MB

A Python library for Blender addons. Blazingly fast preview loads in Blender. Images of arbitrary size. bpy.utils.previews drop-in replacement.

Home Page: https://bonjorno7.github.io/3dn-bip/

License: GNU General Public License v3.0

Python 97.49% Shell 2.51%
blender blender3d blender-addon blender-scripts blender-python pillow png jpg

3dn-bip's Introduction

Please note that we’re no longer actively maintaining the library ourselves. If anyone is interested in assuming ownership of the project, feel free to reach out. We’re aware that the library is an essential component of multiple Blender addons, so we trust it will remain in good hands.

3D Ninjas | Blender Image Preview (BIP) Library

Documentation

  1. Getting Started (this page)
  2. Install Pillow
  3. Reference
  4. More
  5. Development

What is 3DN BIP?

3DN BIP or 3D Ninjas Blender Image Preview is a library, which allows blazingly fast preview image loads in Blender. Furthermore, it can load preview images of arbitrary size. It operates as an bpy.utils.previews drop-in replacement and does all the heavy lifting for you.

Our library enables the following major use cases:

  1. Load preview images shipped as BIP images blazingly fast. We recommend this approach in case you can generate the images beforehand. In this case, your users don't need to take any action to enjoy the speed boost.
  2. Load regular JPEG or PNG preview images blazingly fast. Recommended in case you need to load images provided by the user or by external software tools. For that, we need Pillow on the user's system. It would be best if you use our prepared InstallPillow operator so that your users can enjoy the speed boost with a simple click.

Notes:

  1. Our library will always fall back to bpy.utils.previews if unsupported formats are to be loaded. For this reason, there is absolutely no disadvantage in using this library. In the worst case, we will apply the standard mechanism of Blender.
  2. .bip is a highly optimized image format, which can be transferred to Blender's internal data structures immediately. It is always blazingly fast, whether Pillow is installed or not.

Examples

Download the following sample addons. You can easily install the ZIP files in Blender via the addon preferences tab.

Library

The latest release of the library can be downloaded here: t3dn_bip.zip

Just extract the zip file and copy the folder into your addon. Take a closer look at the examples given above to learn how to use the library.

In case you want to install the library via PyPI, you can use the following command:

python -m pip install t3dn-bip

Converter

The converter is provided via PyPI. Use the following command for the installation:

python -m pip install t3dn-bip-converter

Use the following command to convert images of various formats into the BIP format:

python -m t3dn_bip_converter source_file.png destination_file.bip

Who is using 3DN BIP?

3DN BIP is a new library and is currently being integrated into various addons. The following addons have already been released with 3DN BIP.

KIT OPS

3dn-bip's People

Contributors

bonjorno7 avatar coreprocess avatar ndedakaduki avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

3dn-bip's Issues

Background scene

Would be pretty cool if this could be animated. Things could be a lot cleaner. Even being able to stack scenes up on top of each other would be super great if it actually helps with Blender memory issues. If it does this means user could have larger scenes without bumping into larger problems.

blender_oCDj8m5ZR2.mp4

Would like to know why its so blazing fast

Bumped into an addon using this type and was curious about it. I read the intro of the repo and was wonder why its so blazing fast. Why would it for example load jpg or png faster then blender vanilla does

template_icon_view doesn't display icon names correctly when using bip.

When using bip to load previews, the labels in layout.template_icon_view(show_labels=True) display very incorrectly:

image

Here, the icons' names should just display their index:

for index, path in enumerate(img_paths):
    name = path.name
    icon = pcoll.load_safe(name, str(path), "IMAGE")
    _at_tree_previews.append((name, str(index), name, icon.icon_id, index))

where _at_tree_previews is the return value of the EnumProperty items callback

I also tried this on the example addon provided, and the same problem occurred.
To reproduce this, just set show_labels=True in the template_icon_view method in the example addon

I'm not 100% sure this is caused by bip, but I couldn't replicate it by using the normal bpy.utils.previews method. (Also, just as a side note, otherwise, this is amazing, and it solves a problem I've had for a while with the default blender previews :)

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.