blenderpy | Blender as a python module | Addon library

 by   TylerGubala Python Version: v2.91a0 License: GPL-3.0

kandi X-RAY | blenderpy Summary

kandi X-RAY | blenderpy Summary

blenderpy is a Python library typically used in Plugin, Addon applications. blenderpy has no bugs, it has no vulnerabilities, it has build file available, it has a Strong Copyleft License and it has low support. You can install using 'pip install blenderpy' or download it from GitHub, PyPI.

Meant for installation into a virtualenv or wherever, for unit testing of Blender extensions being authored, or developement of a Blender 3d-enabled Python application. Depends upon the bpy-build module to make sure the Blender bpy module environment is correct.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              blenderpy has a low active ecosystem.
              It has 180 star(s) with 19 fork(s). There are 8 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 17 open issues and 67 have been closed. On average issues are closed in 68 days. There are 3 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of blenderpy is v2.91a0

            kandi-Quality Quality

              blenderpy has 0 bugs and 0 code smells.

            kandi-Security Security

              blenderpy has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              blenderpy code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              blenderpy is licensed under the GPL-3.0 License. This license is Strong Copyleft.
              Strong Copyleft licenses enforce sharing, and you can use them when creating open source projects.

            kandi-Reuse Reuse

              blenderpy releases are available to install and integrate.
              Deployable package is available in PyPI.
              Build file is available. You can build the component from source.
              Installation instructions are available. Examples and code snippets are not available.
              blenderpy saves you 134 person hours of effort in developing the same functionality from scratch.
              It has 337 lines of code, 19 functions and 5 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed blenderpy and discovered the below as its top functions. This is intended to give you an instant insight into blenderpy implemented functionality, and help decide if they suit your requirements.
            • Remove blender scripts
            • Removes the Blender scripts directory
            • Returns the path to the python script
            • Return the path to blenders install
            • Find the BLENDER script directory
            • Prepare the build environment
            • Build bpy
            • Copy Blender python module to destination directory
            • Install Blender scripts
            • Finds the Sass scripts directory
            Get all kandi verified functions for this library.

            blenderpy Key Features

            No Key Features are available at this moment for blenderpy.

            blenderpy Examples and Code Snippets

            No Code Snippets are available at this moment for blenderpy.

            Community Discussions

            QUESTION

            setuptools "eager_resources" to executable directory
            Asked 2019-Sep-16 at 17:30

            I maintain a Python utility that allows bpy to be installable as a Python module. Due to the hugeness of the spurce code, and the length of time it takes to download the libraries, I have chosen to provide this module as a wheel.

            Unfortunately, platform differences and Blender runtime expectations makes support for this tricky at times.

            Currently, one of my big goals is to get the Blender addon scripts directory to install into the correct location. The directory (simply named after the version of Blender API) has to exist in the same directory as the Python executable.

            Unfortunately the way that setuptools works (or at least the way that I have it configured) the 2.79 directory is not always placed as a sibling to the Python executable. It fails on Windows platforms outside of virtual environments.

            However, I noticed in setuptools documentation that you can specify eager_resources that supposedly guarantees the location of extracted files.

            https://setuptools.readthedocs.io/en/latest/setuptools.html#automatic-resource-extraction https://setuptools.readthedocs.io/en/latest/pkg_resources.html#resource-extraction

            There was a lot of hand waving and jargon in the documentation, and 0 examples. I'm really confused as to how to structure my setup.py file in order to guarantee the resource extraction. Currently, I just label the whole 2.79 directory as "scripts" in my setuptools Extension and ship it.

            Is there a way to write my setup.py and package my module so as to guarantee the 2.79 directory's location is the same as the currently running python executable when someone runs

            py -3.6.8-32 -m pip install bpy

            Besides simply "hacking it in"? I was considering writing a install_requires module that would simply move it if possible but that is mangling with the user's file system and kind of hacky. However it's the route I am going to go if this proves impossible.

            Here is the original issue for anyone interested.

            https://github.com/TylerGubala/blenderpy/issues/13

            My build process is identical to the process descsribed in my answer here

            https://stackoverflow.com/a/51575996/6767685

            ...

            ANSWER

            Answered 2019-Sep-16 at 17:30

            Maybe try the data_files option of distutils/setuptools.

            You could start by adding data_files=[('mydata', ['setup.py'],)], to your setuptools.setup function call. Build a wheel, then install it and see if you can find mydata/setup.py somewhere in your sys.prefix.

            In your case the difficult part will be to compute the actual target directory (mydata in this example). It will depend on the platform (Linux, Windows, etc.), if it's in a virtual environment or not, if it's a global or local install (not actually feasible with wheels currently, see update below) and so on.

            Finally of course, check that everything gets removed cleanly on uninstall. It's a bit unnecessary when working with virtual environments, but very important in case of a global installation.

            Update

            Looks like your use case requires a custom step at install time of your package (since the location of the binary for the Python interpreter relative to sys.prefix can not be known in advance). This can not be done currently with wheels. You have seen it yourself in this discussion.

            Knowing this, my recommendation would be to follow the advice from Jan Vlcinsky in his comment for his answer to this question: Post install script after installing a wheel.

            • Add an extra setuptools console entry point to your package (let's call it bpyconfigure).

            • Instruct the users of your package to run it immediately after installing your package (pip install bpy && bpyconfigure).

            • The purpose of bpyconfigure should be clearly stated (in the documentation and maybe also as a notice shown in the console right after starting bpyconfigure) since it would write into locations of the file system where pip install does not usually write.

            • bpyconfigure should figure out where is the Python interpreter, and where to write the extra data.

            • The extra data to write should be packaged as package_data, so that it can be found with pkg_resources.

            • Of course bpyconfigure --uninstall should be available as well!

            Source https://stackoverflow.com/questions/57795839

            QUESTION

            Python setuptools: first build from sources then install
            Asked 2018-Jul-28 at 22:47

            I am having some trouble understanding some of the basic paradigms around setuptools and am hoping to get some help understanding some of the principals and options surrounding setuptools for python.

            Currently, I am working on a cross platform implementation of the blender as a python module build cycle, such that bpy.pyd/ bpy.so could be installed from pip.

            I am successfully able to perform this build process from Windows. You can check out the repo here: https://github.com/TylerGubala/blenderpy

            My primary concerns are as follows:

            1) I have supplementary files to facilitate building for different system architectures; I want to upload these to pypi, not the built binaries

            2) The supplementary files should not live inside the package when it is installed, they are only relevant during the setup/ build process

            3) Currently, the way that the setup script works, is that it builds the modules, then sneakily copies the built files into the site-packages and executable directory for the given python environment. My concern here is: how, when the user runs py -m pip uninstall blenderpy will the package manager know to grab these files and remove them?

            4) What is the correct way to package such a module as this?

            I think my primary disconnect is coming from the fact that I would be using pypi as a build script delivery system, where the actual module that I intend to install is not present until midway through the setup.py execution.

            So how could I install these utilities onto a user's machine, run them, and have my resultant built bpy.pyd be the source for my package?

            Thanks in advance!

            EDIT: I feel I should mention that I read through the following post and, while it seems related it seems to be talking more about 'extras' handlers and the internals of setuptools rather than talking about installing a compiled library that's controlled by python build scripts.

            Python setuptools/distutils custom build for the `extra` package with Makefile

            ...

            ANSWER

            Answered 2018-Jul-28 at 22:47

            UPDATED 28th July, 2018 for multiple improvements that I found.

            I ended up finding through a lot of research and a lot of trial-and-error what I needed to do to accomplish my goal.

            In the end, the solution ended up looking almost exactly like what hoefling over at this question ended up doing:

            Extending setuptools extension to use CMake in setup.py?

            1) Extend the setuptools.Extension class with a class of my own, which does not contain entries for the sources or libs properties

            2) Extend the setuptools.commands.build_ext.build_ext class with a class of my own, which has a custom method which performs my necessary build steps (git, svn, cmake, cmake --build)

            3) Extend the distutils.command.install_data.install_data class (yuck, distutils... however there doesn't seem to be a setuputils equivalent) with a class of my own, to mark the built binary libraries during setuptools' record creation (installed-files.txt) such that

            • The libraries will be recorded and will be uninstalled with pip uninstall bpy
            • The command py setup.py bdist_wheel will work natively as well, and can be used to provide precompiled versions of your source code

            4) Extend the setuptools.command.install_lib.install_lib class with a class of my own, which will ensure that the built libraries are moved from their resultant build folder into the folder that setuptools expects them in (on Windows it will put the .dll files in a bin/Release folder and not where setuptools expects it)

            5) Extend the setuptools.command.install_scripts.install_scripts class with a class of my own such that the scripts files are copied to the correct directory (Blender expects the 2.79 or whatever directory to be in the scripts location)

            6) After the build steps are performed, copy those files into a known directory that setuptools will copy into the site-packages directory of my environment. At this point the remaining setuptools and distutils classes can take over writing the installed-files.txt record and will be fully removable!

            You can check out the up to date repository here: https://github.com/TylerGubala/blenderpy

            Here is a snapshot of what I ended up with:

            Source https://stackoverflow.com/questions/50082055

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install blenderpy

            Prebuilt wheels are provided for popular Platforms (MacOS, Windows, and manylinux). Prebuilds are complete builds with audio, CUDA, and Optix functionality (except for MacOS, which is missing those three), like you would expect with installing the complete application.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/TylerGubala/blenderpy.git

          • CLI

            gh repo clone TylerGubala/blenderpy

          • sshUrl

            git@github.com:TylerGubala/blenderpy.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Addon Libraries

            anki

            by ankitects

            ember-cli

            by ember-cli

            trojan

            by Jrohy

            data

            by emberjs

            Try Top Libraries by TylerGubala

            bpy-build

            by TylerGubalaPython

            anki-vector-news-anchor

            by TylerGubalaPython

            cmake-generators

            by TylerGubalaPython

            pippm

            by TylerGubalaPython

            javascript-collections

            by TylerGubalaJavaScript