18. Building the update logic for elements

Questions and discussion for this lecture live here. Fire away by hitting Reply below :fire:

Hi Sean,

Iā€™m really enjoying the course so far; itā€™s definitely one of my favorites on this platform. Thanks for putting it together!

Iā€™m running into a couple of issues and was hoping to get some advice.

First, Blender has been crashing quite a bit, which is a little frustrating. Iā€™m trying to save frequently as you recommended at the beginning of the course, but I was wondering if thereā€™s anything else I could do to improve stability and reduce these crashes.

Second, Iā€™m having some trouble with the item updating implementation in Serpens. The node logic makes sense to me, and Iā€™ve replicated the steps in Serpens, double-checking against your implementation. Everything seems to match, but the code isnā€™t working as expected. I suspect the issue might be with the ā€œFunction Runā€ node for the Update Elements function. When I try to connect its output, the wire turns red, which seems like an error. In the terminal, I get the following:

Blockquote
Compiled successfully!
Traceback (most recent call last):
File ā€œā€, line 223, in sna_update_sna_structure_object
File ā€œā€, line 72, in sna_update_sna_structure_object_DB425
TypeError: object of type ā€˜NoneTypeā€™ has no len()
File ā€œā€, line 221, in sna_update_sna_structure_object

Additionally, Iā€™m unable to use the Print node to debug the output, as the Print node no longer seems to be working, even for parts of the code where I previously verified it was functioning correctly. Iā€™m sure Iā€™m missing somethingā€¦

Hey @Oliviero - great to hear youā€™re enjoying the course! Donā€™t forget to leave a review :wink:.

Ok - Blender does crash a little more than usual when youā€™re building addons - as I explain in the course - this is somewhat to be expected since weā€™re essentially generating code with our NodeTrees. That said - it shouldnā€™t be crashing so frequently that it becomes a significant issue during development. While originally developing StructureWorks - crashes were relatively frequent (say 1 every hour or two) but getting in the habit of manically saving my file, reduced this to a minor annoyance.

If Blender crashes when connecting up nodes - thatā€™s your first clue, look at what nodes youā€™ve just connected immediately before the crash - usually, youā€™ll be able to determine what the issue is - the console messages can also be helpful (and sometimes cryptic!) The only real advice I have for you here is to just try and tackle the source of each crash as it happens - try not to let multiple crashing bugs start to accumulate - and remember you always have the downloadable development file to compare against.

For youā€™re second question - itā€™s difficult for me to say exactly what the problem is - but you are correct - if the wire turns red, it means there is a compatibility error - youā€™re trying to do something that doesnā€™t make sense, could be a mismatched data type or a mismatched node type for example.

If youā€™re really hitting a brick wall with this - email me your development file (and associated scripts) in one big zip folder and Iā€™ll take a quick look for you.

BTW - Iā€™m just wrapping up the next batch of lectures - should go live this week.

SeƔn