Questions and discussion for this lecture live here. Fire away by hitting Reply below
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 .
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
Hey @Sean, I managed to solve it, and I really appreciate your helpful suggestions! I think what I needed most was to step away and come back to āthe codeā with a fresh mind. I realized I had a few key connections missing because I didnāt fully understand how some nodes worked. Looking back now, I couldnāt see those mistakes the other dayāI was probably just too tired.
While I have your attention, Iād like to ask you something else. I couldnāt find much online documentation about how to reference Blender elements in a Python script. For example, in our script for updating elements, we use something like edge.vertices[0]
. But how do I figure out that āverticesā is the correct way to access the vertices of the element? (I hope itās considered a āmethod,ā but Iām not really sure about the terminology).
This example is maybe too simple because it feels intuitive, but in other cases, knowing how to navigate stuff like this would be useful.
Oliviero
p.s. I wanted to progress a bit further in the course so I could leave a more comprehensive review, but Iāll definitely write one soon! As I mentioned, this course is something Iām really enjoying, and I find it opens up so many possibilities.
p.p.s. I also canāt wait to see the new lessons!
Yes - very often, a break is all thatās needed!
In terms of API docsā¦you should find all you need hereā¦Blenderās official API doc siteā¦itās basically āground zeroā for all Blender Python API infoā¦
No rush on your review
Cheers,
SeƔn