Explorar o código

Editor: Avoid dispatching unneeded events when adding materials.

Mr.doob %!s(int64=5) %!d(string=hai) anos
pai
achega
a74cd7f830
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      editor/js/Editor.js

+ 2 - 0
editor/js/Editor.js

@@ -231,6 +231,8 @@ Editor.prototype = {
 
 	addMaterial: function ( material ) {
 
+		if ( material.uuid in this.materials ) return;
+
 		this.materials[ material.uuid ] = material;
 		this.signals.materialAdded.dispatch();