1
$\begingroup$

Note: both Blender SE and google are currently useless for this somewhat simple subject, so bump this question up for others like me.

I would like to extend a blender class (BMesh.types.BMEdge) into a custom class, "PEdge", so that I can add some extra parameters. I want to replace all the BMEdges in my BMesh with my new PEdges as well. How can this be achieved in blender python?

$\endgroup$
3
$\begingroup$

You cannot use a bmesh element as a base type

Unfortunately as possible with many blender types, it is not possible to use bmesh elements as base types to extend the class in a "traditional way".

>>> class Foo(bmesh.types.BMEdge):
...     pass
...     
Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
TypeError: type 'BMEdge' is not an acceptable base type
| improve this answer | |
$\endgroup$
  • $\begingroup$ I know. I have tried that already. The question is what should I do (the NON-traditional way)? $\endgroup$ – user97005 May 28 at 4:45
  • $\begingroup$ No. I am quite unfamiliar with Blender's Python API. I am unsure what the 'Blender Way' of adding information to a data type is. $\endgroup$ – user97005 May 28 at 4:52

Your Answer

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