4
$\begingroup$

So i have a old piece of script, and its no longer valid in 2.82, as in the object structure it refers to is no longer valid.

for i in bpy.data.objects:
        i.rotation_mode = 'ZXY'

Now i tried to get wiser on the new object structure, first by recursive printf debugging in pairs (fizzle out with errors in console). Then by reading up on it that dozens of tutorials for various versions, of which only a few had examples for this and - if they had the examples did not work / show the whole path.

My question. Is there a add-on, that adds a button, with which i can pick a scene element/element-attribute such as that its whole path in the scripting environment is revealed?

A searchable data-explorer like add-on for the scripting environment would fulfill the same purpose. Same would go for a doxygen diagram of the scene-data layout would be great.

$\endgroup$

1 Answer 1

4
$\begingroup$

Tools

There is no such add-on, to the best of my knowledge. There is however a tool that you've probably already enabled that helps to a certain extent. If you edit Preferences you can enable Developer Extras and Python Tooltips in the Interface Tab:

Interfaces tab of Preferences highlighting developer extras and python tooltips.

Now when you hover over many things in the interface, you will see additional information in the tooltip, as in this example:

Hover showing python tooltip

In addition to seeing the Tooltip, if you right click, the pop up menu will have two options for copying the data path, and an option to edit the source code:

right click menu showing Python related options

as well as an option to access the Python Reference Manual. Combined with the Python Console, the Console Window (terminal output), and the info window, these are the best sources of information available to you in a running blender instance.

It's not always possible to edit the source, and often the source will be for the UI rather than the object. Sometimes the tooltip information requires some extra decoding, and sometimes it is not available. This support gets better with each release, but it's never 100% perfect.

Other support

In addition to Blender StackExchange, here are some additional resources for Blender Python questions. There are many others:

  • Devtalk This isn't a support forum, but rather

    a dedicated place for Blender module teams to reach out to contributors - development questions are welcome.

  • #python A Blender chat channel for discussing using Python in Blender.

  • bpy (link goes to Twitter announcement with Discord invite) A Discord server dedicated to

    Blender Python developers and people striving to become Blender Python developers.

Useful add-ons

Neither of these add-ons specifically do what you asked, but both are helpful:

  • bpy_helper by Iyad Ahmed is a collection of helper tools
  • EasyBPY By Curtis Holt is a different collection.

There are many others, of course. These are just an introduction.

$\endgroup$
2
  • 2
    $\begingroup$ Thanks, this is exactly what i was looking for. Great help! $\endgroup$
    – Pica
    Jan 31 at 0:11
  • 2
    $\begingroup$ You're welcome. I look forward to seeing what you accomplish in Python. $\endgroup$ Jan 31 at 0:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.