#PythonScripting

2023-08-28

Trying to add a PointerProperty for a PropertyGroup, I didn’t include specific from imports and was getting an error trying to use a naked PointerProperty. So I prefixed it with “bpy.types.” After spending an embarrassing amount of time trying to figure out why I was getting the following:

TypeError: bpy_struct.__new__(type): expected a single argument

I tried adding a specific import for the class. Suddenly the error was gone and my thing worked (after working through later errors)!

But why couldn’t I address the class directly? Ha ha. Turns out there there is a class in one module and a function in another. Guess which one I used. 🙃

bpy.props.PointerProperty is the function I should have been using all along.

#Blender3D #PythonScripting #ApplicationProgrammingInterface

burdGISburdGIS
2023-03-18

Power up your QGIS with the latest QChatGPT plugin (v0.3) by Marios Kyriakou! 💻🌟 Perform geocoding (sort of)🗺️, python scripting 🐍 and more with ease. Check out the tutorial now! 🔥
youtu.be/NxonmCukM7A

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst