@@ -376,7 +376,8 @@ def undo(self):
376376 layer = layer , create = False ,
377377 comp_layer = comp ,
378378 ** self .prev_data )
379- if self .attr_name == INTERNAL_ATTRS .INSTANCE_PATH :
379+ if self .attr_name in (INTERNAL_ATTRS .INSTANCE_PATH ,
380+ INTERNAL_ATTRS .ENABLED ):
380381 dirties += result
381382 if self .attr_name in INTERNAL_ATTRS .ALL :
382383 dirties += comp .get_node_dirties (self .node_path )
@@ -389,7 +390,8 @@ def undo(self):
389390 else :
390391 if (self .remove_attr or self .created_node_paths or
391392 self .attr_name in (INTERNAL_ATTRS .INSTANCE_PATH ,
392- INTERNAL_ATTRS .PARENT_PATH )):
393+ INTERNAL_ATTRS .PARENT_PATH ,
394+ INTERNAL_ATTRS .ENABLED )):
393395 self .model .nodes_changed .emit (dirties )
394396 else :
395397 self .model .attrs_changed .emit (changed_attrs )
@@ -401,7 +403,7 @@ def undo(self):
401403
402404 @processing
403405 def redo (self ):
404- start = time .time ()
406+ # start = time.time()
405407 created_node = False
406408 self .prev_selection = self .model .selection
407409 layer = self .model .lookup_layer (self .layer_path )
@@ -446,16 +448,20 @@ def redo(self):
446448 create = True ,
447449 comp_layer = comp ,
448450 ** self .data )
449- if self .attr_name == INTERNAL_ATTRS .INSTANCE_PATH :
451+ if self .attr_name in (INTERNAL_ATTRS .INSTANCE_PATH ,
452+ INTERNAL_ATTRS .ENABLED ):
450453 dirties += self .return_value
451454 if self .attr_name in INTERNAL_ATTRS .ALL :
455+ # TODO: Some functions already calculated the dirty nodes,
456+ # do we really need to do it again here?
452457 dirties += comp .get_node_dirties (self .node_path )
453458 if self .recomp :
454459 self .model .update_comp_layer (rebuild = self .recomp )
455460 else :
456461 if (self .remove_attr or self .created_node_paths or
457462 self .attr_name in (INTERNAL_ATTRS .INSTANCE_PATH ,
458- INTERNAL_ATTRS .PARENT_PATH )):
463+ INTERNAL_ATTRS .PARENT_PATH ,
464+ INTERNAL_ATTRS .ENABLED )):
459465 self .model .nodes_changed .emit (dirties )
460466 else :
461467 changed_attrs = ()
0 commit comments