Page MenuHome

FIX T102383: Initialize bpyob properly
ClosedPublic

Authored by Mark Blair (markusblair) on Nov 10 2022, 7:19 PM.

Details

Summary

bpyob was being accessed on line #3568 without being initialized.

It appears it should just be initialized on line #3566 much like other areas in this file such as:
#3296:

bpyob = node.blendData = node.blendObject = bpy.data.objects.new(name, None)
bpycollection.objects.link(bpyob)
bpyob.select_set(True)

#3107:

bpyob = node.blendData = node.blendObject = bpyob.copy()
# Could transform data, but better the object so we can instance the data
bpyob.matrix_world = getFinalMatrix(node, None, ancestry, global_matrix)
bpycollection.objects.link(bpyob)
bpyob.select_set(True)

#3053:

bpyob = node.blendObject = bpy.data.objects.new(vrmlname, bpydata)
bpyob.matrix_world = getFinalMatrix(node, None, ancestry, global_matrix)
bpycollection.objects.link(bpyob)
bpyob.select_set(True)

Diff Detail

Event Timeline

@Bastien Montagne (mont29) Looks like this may have been introduced with this commit: https://developer.blender.org/rBAe8da70ab73d2dd5ff46e47c87cf2da633446670f
I know little about Python or Blender, mind confirming that these changes are logical and correct?

Indeed, thanks for the fix!

This revision is now accepted and ready to land.Nov 16 2022, 6:04 PM