Closed tsvilans closed 3 years ago
Hey Tom!
Unfortunately, I'm not able to reproduce this error. The code you have written up should work just fine which makes me think either (1) the object you are retrieving is an edge case that I definitely want to look into or (2) Blender sets it's own lowered recursion limit for external python modules.
If possible, could you please share me on the stream and point me to the offending commit so I can see if I can reproduce the error with the same data? I would be curious to see it as I have previously received whole buildings constructed of lots of breps without running into recursion errors!
Sure thing. It's a simple stream I made using the web interface, and then uploaded a simple box to it from Rhino:
stream id: 1416bd66bb
branch: main
commit: ed05c70b05
Receiving the box in Rhino works fine, by the way.
Solved: was using an older version of pydantic
. Upgraded by going to C:\Program Files\Blender Foundation\Blender 2.92\2.92\python\Scripts
and doing pip install pydantic==1.7.2 --upgrade <Blender modules directory>
.
ah great! glad to hear it was a simple fix π
π back to boot camp.
A related question: how would you get a list of all children objects from that Base
object? I see @Default
in the object keys, but there are other keys as well, that don't correspond to children objects (speckle_type
, units
, __closure
). Is the correct way to filter the key list for keys beginning with @
?
There isn't a set way to get the names of all child objects, though this is something we can add if it would be a helpful addition. There are a couple different methods for getting the property names on a base object: get_member_names
, get_typed_member_names
, and get_dynamic_member_names
. You would probably want to use the first one to get all member names and filter them by type (inherits from Base
).
Note that only dynamically added detached properties start with an @
. Properties that are predefined on the object class can also be defined as detached. Eg, vertices
and faces
on a Mesh
object are detached (making them children objects) but they are predefined on the Mesh
class and do not start with an @
. Check out the docs for more info on the py base object here.
Executing this:
Expected vs. Actual Behavior
Expecting to receive
res
object. Instead it goes into a loop:Reproduction Steps & System Config (win, osx, web, etc.)
Example code above. Running on Windows 10.
Proposed Solution (if any)
Some small examples of querying available streams and receiving all objects from a stream would help to compare code.
Running:
works:
However it is not entirely clear how to get a list of children objects from this result...