You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Example use of OperatorProperties is in the description classmethod of Operator subclasses or in cases of checking whether a specific property of an Operator instance is set or if the default value of that property is being used.
The properties of the Operator can be accessed from its OperatorProperties through the same, normal attribute access, but PyCharm will consider these attributes to not exist since they're not defined in the OperatorProperties class.
Adding a __getattr__ stub method to OperatorProperties will suppress warnings when accessing attributes that don't exist in the class. (adding __getattribute__ seems to work too)
The method must have a docstring indicating
I'm not anticipating that there will be a way to signify to PyCharm that it should look at the attributes of the Operator instead.
Note that the properties of Operator instances may actually be stored in its OperatorProperties (.properties). The Operator class overrides __getattribute__ to get attributes from its OperatorProperties if the name of the attribute matches a property defined in the OperatorProperties. See the Operator class in bpy_types.py of Blender.
The text was updated successfully, but these errors were encountered:
Example use of
OperatorProperties
is in thedescription
classmethod ofOperator
subclasses or in cases of checking whether a specific property of anOperator
instance is set or if the default value of that property is being used.The properties of the
Operator
can be accessed from itsOperatorProperties
through the same, normal attribute access, but PyCharm will consider these attributes to not exist since they're not defined in theOperatorProperties
class.Adding a
__getattr__
stub method toOperatorProperties
will suppress warnings when accessing attributes that don't exist in the class. (adding__getattribute__
seems to work too)The method must have a docstring indicating
I'm not anticipating that there will be a way to signify to PyCharm that it should look at the attributes of the
Operator
instead.Note that the properties of
Operator
instances may actually be stored in itsOperatorProperties
(.properties
). TheOperator
class overrides__getattribute__
to get attributes from itsOperatorProperties
if the name of the attribute matches a property defined in theOperatorProperties
. See theOperator
class inbpy_types.py
of Blender.The text was updated successfully, but these errors were encountered: