NameError 变量声明,变量作用域

huangapple go评论73阅读模式
英文:

NameError var declaration,var scope

问题

I don’t know python and i found this script, I want to use it in blender for a 3d model. There is a name error I don’t know how to solve it, is there any way to make the variable global from the ‘if statement’ ?

enter image description here

I don’t know python i just want to use the script in blender

英文:

I don’t know python and i found this script, I want to use it in blender for a 3d model.There is a name error I don’t know how to solve it,is there any way to make the variable global from the ‘if statement’ ?

enter image description here

I don’t know python i just want to use the script in blender

答案1

得分: 1

Translate the requested code snippet:
只需在导入语句后面的顶部定义bsdf变量;

import bpy

bsdf = None

... 代码的其余部分 ...
英文:

Just define the bsdf variable on the top after the import statement;

import bpy

bsdf = None

... rest of the code ...

huangapple
  • 本文由 发表于 2023年6月29日 23:28:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/76582510.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定