#Tool scripts causing mesh data to corrupt/delete in 3d scene

2 messages · Page 1 of 1 (latest)

grim rivet
#

I wrote a couple of tool scripts. Each works independently okay. I wrote a little look_at node script just so I could slap it in and assign its exports and have a quick look_at as a Node in my 3D scenes. Works fine. I also wrote this sort of FK driver script I called Bendy Armature. It reads start rotations and rotation offsets of control meshes, and applies a smooth adjustment over groups of bones in an armature. Works fine by itself. If I try to use the look_at node to update the rotation of my rotation control meshes, though, the mesh my Skeleton is deforming just drops its mesh data. WTF is going on? Seriously? How can two scripts which work fine alone and literally only one affects the other's output indirectly, cause the mesh data itself to just vanish? What kind of crack is Godot smoking? lol

I would love to find out I'm just missing something obvious here:

Script for BendyArmature included as attachment.

Script for LookatConstraint below:

@tool
class_name LookatConstraint extends Node


@export var node3D_looking: Node3D = null
@export var node3d_to_lookat: Node3D = null
@export var modified_up_vector: Vector3 = Vector3.UP
@export var use_model_front: bool = false
@export var inverted: bool = false



func _process(_delta):
    if not is_instance_valid(node3d_to_lookat) or not is_instance_valid(node3D_looking):
        return
    
    node3D_looking.look_at(node3d_to_lookat.global_position, modified_up_vector, inverted)

Both work fine alone. Together, they corrupt/delete mesh data somehow, as far as I can tell. (It's irreversible)

#

There are some choice relics of past issues I left in as Easter Eggs from me fixing earlier issues. I get cheeky with myself in my prints sometimes...