natecraddock / projectile

An artist-friendly tool for throwing stuff around inside Blender
GNU General Public License v3.0
165 stars 12 forks source link

AttributeError: 'NoneType' object has no attribute 'objects' #20

Open JVimes opened 1 year ago

JVimes commented 1 year ago

I installed the add-on, selected default cube, clicked "New Emitter" and got the following error. I'm using Blender 3.4.1 on Windows 10.

bpy.ops.rigidbody.object_add()
Python: Traceback (most recent call last):
  File "C:\Users\username\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\projectile\ops.py", line 66, in execute
    object_collection.objects.link(empty)
AttributeError: 'NoneType' object has no attribute 'objects'
natecraddock commented 1 year ago

Hi @JVimes thanks for reporting! I don't keep up-to-date with Blender as much as I should, so it's possible the latest version introduced some incompatibilities. I'll look into this later today!

JVimes commented 1 year ago

Thanks! No rush of course.

natecraddock commented 1 year ago

Hi @JVimes, sorry for the delay. I think I found the issue. Can you confirm?

I think what happened is that the cube was under the scene collection rather than the built-in default collection right? I can fix that easily if that is the case.

JVimes commented 1 year ago

Oh, yes, I got rid of the nested collection in my default scene. Sounds like a likely culprit.

natecraddock commented 1 year ago

Thanks! Short-term workaround is to put your object in a collection. I'll make some code changes to handle the scene collection soon