I have noticed that when creating addon, if the bl_info
is create with variable. The script will break the addon system. Causing disappear tab after restarting blender:
desc = 'Run script in any space with given name of script'
import bpy
bl_info = {
"name": "Run specified script in all context",
"description": desc, # Here, a variable. (And WTF is this code highlight?)
"author": "hikariTW",
"version": (0, 1, 0),
"blender": (2, 80, 0),
"location": "TextEditor",
"support": "TESTING",
"category": "Interface",
}
Is there any workaround or this is normal when dealing with static examine of script when Blender try to list them out?
The test is done in Blender 2.83.4
Further testing which also break addon:
- f-string and
str.format
- formatting with const-like
15
'foobar'
without variable. - Conditional Expression:
"foo" if True else "bar"
"description" : f"{desc}",
? $\endgroup$int
orstr
. Includingf"{desc}"
and"{}".format(150)
. It seems that it need to be pure text formatting without any statement. $\endgroup$