2
0
Эх сурвалжийг харах

Revert "Emitter: remove template instances in context, which cause problems with selection"
This is breaking shader applications in emitters, which currently need context
This reverts commit 725107f4e9fdc49fed7ed13644715010935f0b34.

trethaller 4 жил өмнө
parent
commit
68225702e3

+ 1 - 6
hrt/prefab/fx/Emitter.hx

@@ -767,10 +767,8 @@ class EmitterObject extends h3d.scene.Object {
 			// Should we do this manually here or make a recursive makeInstance on the template?
 			var materials = particleTemplate.getAll(hrt.prefab.Material);
 			for(mat in materials) {
-				if(mat.enabled) {
+				if(mat.enabled)
 					mat.makeInstance(template);
-					template.shared.contexts.remove(mat);
-				}
 			}
 
 			// Setup shaders
@@ -779,7 +777,6 @@ class EmitterObject extends h3d.scene.Object {
 			for( shader in shaders ) {
 				if( !shader.enabled ) continue;
 				var shCtx = shader.makeInstance(template);
-				template.shared.contexts.remove(shader);
 				if( shCtx == null ) continue;
 				hrt.prefab.fx.BaseFX.getShaderAnims(template, shader, shaderAnims);
 			}
@@ -806,8 +803,6 @@ class EmitterObject extends h3d.scene.Object {
 				batch = new h3d.scene.MeshBatch(meshPrim, mesh.material, this);
 				batch.name = "batch";
 			}
-
-			template.shared.contexts.remove(particleTemplate);
 			template.local3d.remove();
 		}
 	}