ioxu / microscratches-generator

A texture generator for controlling the rotation of anisotropic reflection in shading models for 3d renderers.
MIT License
4 stars 0 forks source link

only connect dirty-related signals for layers that are generators #20

Closed ioxu closed 1 year ago

ioxu commented 1 year ago

(Ignoring the fact that there is only a single generator texture_scene presently, namely test_lines.tscn) Adding a non-generator texture_scene, eg debug_9_swatches.tscn causes errors related to missing signals. Erroring on

ioxu commented 1 year ago

https://github.com/ioxu/microscratches-generator/blob/a8dd0184ad1c72560dad39cddea2866cd272fe2b/scenes/layerManager.gd#L193-L194

Only connect these signals if the layer is a generator? or has method is_dirty() ?

ioxu commented 1 year ago
func connect_layer_signals(layer)->void:
    layer.connect( "selected", self, "_on_layer_selected" )
    layer.connect( "deselected", self, "_on_layer_deselected" )
    layer.connect( "layer_visiblity_toggled", ui_root, "_on_layer_visibility_toggle")
    if layer_is_generator( layer ):
        layer.texture_scene.connect( "dirty", layer,  "_on_texture_scene_dirty" )
        ui_root.connect( "dirtied_by_ui", layer.texture_scene, "_on_set_dirty" )

Seems to work, no more errors.