Page MenuHome

Addon Tutorial Page not updated for 2.8
Closed, ResolvedPublic

Description

https://docs.blender.org/manual/en/latest/advanced/scripting/addon_tutorial.html

Under "Install the Add-on" it fails to mention how to run the addon code.

Under "Write the Add-on" it makes jazz hands in the direction of the space bar, which i'm told is a 2.79 shortcut.

Event Timeline

Germano Cavalcante (mano-wii) changed the task status from Needs Triage to Needs Information from User.Jan 16 2020, 3:10 PM

Could you be more specific?
I read the topic "Install the Add-on" and found no outdated information in it.

Sybren A. Stüvel (sybren) claimed this task.

Under "Install the Add-on" it fails to mention how to run the addon code.

The add-on code is run when you enable the add-on. This is indeed not written explicitly, but it has little to do with being updated for Blender 2.8x or not. I have added a sentence to the tutorial to clarify this.

Under "Write the Add-on" it makes jazz hands in the direction of the space bar, which i'm told is a 2.79 shortcut.

In 2.79 Space was the default shortcut for 'Play', but in Blender 2.8x Space is used to search for operators. The text is thus correct for Blender 2.8x.

@Sybren A. Stüvel (sybren)

The add-on code is not run when you enable it, it is run when you trigger it via the command search. Only the registration is triggered via enabling it. Not Class.execute()

The keyboard shortcuts are in fact the opposite way around. After resetting Blender to factory defaults, this is what i see in the Blender27x and Blender presets:


Under "Write the Add-on" it makes jazz hands in the direction of the space bar, which i'm told is a 2.79 shortcut.

In 2.79 Space was the default shortcut for 'Play', but in Blender 2.8x Space is used to search for operators. The text is thus correct for Blender 2.8x.

@Sybren A. Stüvel (sybren)

In 2.79 Alt-A was the default shortcut for play, but in Blender 2.8x it is Space. The default shortcut to search for operators is F3 in 2.8x.

@Sybren A. Stüvel (sybren)

The add-on code is not run when you enable it, it is run when you trigger it via the command search. Only the registration is triggered via enabling it. Not Class.execute()

It all depends on what you mean with "the add-on code". The Python code in the add-on file is executed upon enabling the add-on. If you define an operator, the operator doesn't run until you execute it, but the add-on code has been run by that time already (or the add-on's operator wouldn't even exist in memory). There is a distinct difference between "the add-on code" and "the operator in the add-on code". How to run the operator is actually described in the preceeding Write the Add-on (Simple) section, but I guess it doesn't hurt to mention that this is still the same after installing the add-on from a separate Python file.

The keyboard shortcuts are in fact the opposite way around.

You're right, I mixed them up.