I'm trying to follow the scripts from the book The Blender Python API by Chris Conlan, and I've been unable to import modules in Python from Blender (2.81) on osx 10.15.2. What file structure / linking is needed to import modules in Blender 2.8?  The closest question I've seen here is , which seems to be close, but the single answer there doesn't work for me. (I don't currently have enough reputation to comment over on that question.)  Specifically, I'm trying to run  from . The problem is that I don't know how the file  should be handled. Where should it be placed? Does it need to be linked into the blender file somehow?  I've so far been unable to set up a minimal example to get anything to import from another module source file, either using the code from the book or with a . The source code from the book needs minimal refactoring to work with 2.8, but otherwise seems functional.
2051
I'm currently developing a script for Blender to handle Mesh Frequency Decomposition.  The script is nearly complete, but i need one more thing: The SciPy library to compute eigenvalues and eigenvectors.  Following the installation instructions on , I'm able to install it as well as Numpy. Numpy works fine, but I can't even import SciPy:  Traceback (most recent call last): File "/CAF_FD.py", line 4, in &lt;module&gt; ImportError: No module named 'scipy' Error: Python script fail, look in the console for now...   By the way, I'm working on Linux 64 bit and I've installed SciPy and Numpy with my package manager.  Edit: When I try to use SciPy with a terminal prompt, it works.
103714
How are various maps such as diffuse, AO, cavity, or displacement imported into Blender?  I saw the Texture tab has import image, would you do this for all maps and connect them somehow?
56234
I am trying to modify an object after importing it. This post is related to   import bpy full_path_to_file = "C:\\Users\\xyz\\Documents\\test.obj" bpy.ops.import_scene.obj(filepath=full_path_to_file) # create the material mat = bpy.data.materials.new('MaterialName') mat.diffuse_color = (1.0,0.0,1.0) mat.diffuse_shader = 'LAMBERT' mat.diffuse_intensity = 1.0  # get the object obj = bpy.data.objects['Cube']  # get the material mat = bpy.data.materials['MaterialName']  # assign material to object obj.data.materials.append(mat)   I wanted to add a material to the imported object but that is not happening. So I tried to scale it even that is not happening.  I realized that no operation is being performed on the imported objects. But the same operations are executing on the objects that are created (i.e. not imported).  Any help would be appreciated.
99054
I'm still new with python and scripting. I tried editing the . Since I'm exporting tons of object groups, I need each of scene collection or selected objects to be exported as an :  import bpy import os  # get the path where the blend file is located basedir = bpy.path.abspath('//')  # deselect all objects # bpy.ops.object.select_all(action='DESELECT')      # loop through all the objects in the scene scene = bpy.context.scene for ob in scene.objects:     # make the current object active and select it     scene.objects.active = ob     ob.select = True      # make sure that we only export meshes     if ob.type == 'MESH':         # export the currently selected object to its own file based on its name         bpy.ops.export_scene.gltf(                 filepath=os.path.join(basedir+'gltf-individual', ob.name + '.gltf'),                 use_selection=True,                 )     # deselect the object and move on to another if any more are left     ob.select = False   Q: Can someone help me with this?
46202
I'm trying to amend an addon that I made for Blender 2.7X to work with Blender 2.80. The problem is with  bpy.context.scene.objects.active = some_object   This is how I used to set an active object, the problem is, active property was removed in the new API!,reading other Q&amp;As, I found 2 suggestions:  bpy.context.object   and  bpy.context.active_object    The problem is, both of these will return the already active object, but when I try to use them this way:  bpy.context.active_object = some_object   or   bpy.context.object = some_object   I'm getting an AttributeError: property is read-only!  I tried the documentation with no luck!  EDIT:  According to Blender 2.8 WIKI API changes:   bpy.context.scene.objects.active   changed into  bpy.context.render_layer.objects.active   This doesn't work, AttributeError: 'Context' object has no attribute 'render_layer'
92610
I'm using Blender 2.8+ and I found a web page containing a nice . I copied the script in Blenders text editor and an error occurred at line 88:  bpy.context.scene.objects.link (object)      AttributeError: 'bpy_prop_collection' object has no attribute 'link'   Error: Python script failed, check the message in the system console   Unfortunately, I have no idea what a 'bpy_prop_collection' is and I don't know where to start fixing this issue. What I need to do in order to make the script work for Blender 2.8x?
67782
As part of an existing add-on, I'm trying to create an object and add it to the scene using Python. I followed a Blender Cookbook tutorial found here: . I use the following code to do so:  emptyMesh = bpy.data.meshes.new('emptyMesh') theObj = bpy.data.objects.new("object_name", emptyMesh) bpy.context.scene.objects.link(theObj)   But I get the following error when I try to link theObj to the scene objects:  AttributeError: 'bpy_prop_collection' object has no attribute 'link'   This works just fine in Blender 2.76-2.79, but doesn't work in the 2.80 test build I downloaded. Was there a change to the Python API? Or is this maybe a bug in the test build?
50296
I'm trying to import an OBJ file that has associated MTL and PNG files. There's a similar question , but the answer is not very helpful, I just see a big blob.   that I'm trying to import. Inside the textured meshes folder there's a few different versions of the object but none seem to import correctly with the texture applied.  I also don't have access to the material and object (as well as a few other) buttons. (see the picture)    Blender 2.71
8457
just downloaded todays Blender 2.8 build and it seems I can no longer import a function from another Textblock. Works well on a build from April 5th (haven't updated since then).  This simple example is not working in todays build:
9674
I keep on getting context errors in the Blender Python API.  I don't understand the issue of the context in the API, how do I know which is the correct context?   Thanks!
27456
What's the "Bad magic number" ImportError in python, and how do I fix it?  The only thing I can find online suggests this is caused by compiling a .py -> .pyc file and then trying to use it with the wrong version of python. In my case, however, the file seems to import fine some times but not others, and I'm not sure why.  The information python's providing in the traceback isn't particularly helpful (which is why I was asking here...), but here it is in case it helps:  Traceback (most recent call last):   File "run.py", line 7, in &lt;module&gt;     from Normalization import Normalizer
21007
How do I import a Python module given its relative path?  For example, if dirFoo contains Foo.py and dirBar, and dirBar contains Bar.py, how do I import Bar.py into Foo.py?  Here's a visual representation:  dirFoo\     Foo.py     dirBar\         Bar.py   Foo wishes to include Bar, but restructuring the folder hierarchy is not an option.
109310
How can I use the python API to find the most reliable location that an add-on can use to store data like images, assets, etc. automatically?  It's important that this location:   doesn't change for different versions of blender doesn't get deleted on system reboot like some temp folders is available on every OS   One option I've found is to use bpy.utils.resource_path('USER') which ends in the version number (on windows C:\Users\blah\AppData\Roaming\Blender Foundation\Blender\2.78), but then do a  to the folder above it. Is there a better way?
75192
I am getting the following error in a Drupal 8 site.     The following module is missing from the file system   It looks as if a custom module was installed and deleted without uninstalling it.   How can I fix this error?
54763
I just enabled the Blenderkit addon but cannot seem to figure out how to edit the objects. I looked in this reddit thread and amazingly none of the solutions worked for me.  Making it a single user object, data, and materials did not work. I do not see any option to append when adding a model form the Blenderkit asset bar (I even tried saving it and appending the object in another instance of Blender and it still would not let me edit it). And when I right click I do not see an option to make local on outliner collection. I am using Blender 2.83 if that makes a difference but can use 2.9 if need be. Any other solutions?
83605
In blender, Import has no .blend option..so how can I import .blend file in my current blend file?
6872
Python3.4.0  on Ubuntu 14.04.01 LTS. We can use it by typing on Terminal `python3.  I want to use Numpy for Python3.4.0. I run import numpy  but I had anImportError.So sudo apt-get install python-numpy. Then I typed on Terminal:python3`. Then import numpy. I got this error:  &gt;&gt;&gt; import numpy Traceback (most recent call last):   File "&lt;stdin&gt;", line 1, in &lt;module&gt; ImportError: No module named 'numpy' &gt;&gt;&gt;    Nevertheless, Numpy is now working for Python-2.7:  begueradj@begueradj-Bill:~$ python Python 2.7.6 (default, Mar 22 2014, 22:59:38)  [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. &gt;&gt;&gt; import numpy &gt;&gt;&gt;    How can I make Numpy work for Python 3.4.0 ?