Notifications
Clear all

[Closed] getNameByName affter gc() got a "system exception"

getNodeByName affter gc() got a “system exception”. I have a mesh object. named “kp02tokp03”. use “when constraction” to build it dynamicly . it works fine . but affter gc(). use getNodeByName “kp02tokp03” to get the object .then got a “system exception”. … I really dont know. where is the problem.!

2 Replies

i have had problems with getNodeByName in the past so i usually just iterate the objects collection using matchpattern and return the first result.

fn getObjByName pattern =
 (
(for o in objects where matchpattern o.name pattern:pattern collect o)[1]
 )
getObjByName "kp02tokp03"

Suggestions

Run gc() at the end of the script.
myNode = execute (“$’” + “kp02tokp03” + “’”)
Try gc light:true