Explorar o código

Merge branch 'master' of https://github.com/HeapsIO/hide

Tom SPIRA %!s(int64=6) %!d(string=hai) anos
pai
achega
ae32cc56a8
Modificáronse 2 ficheiros con 22 adicións e 6 borrados
  1. 1 0
      hide/comp/SceneEditor.hx
  2. 21 6
      hrt/prefab/l3d/MeshGenerator.hx

+ 1 - 0
hide/comp/SceneEditor.hx

@@ -855,6 +855,7 @@ class SceneEditor {
 		el.find("a").first().toggleClass("favorite", isFavorite(p));
 
 		if(obj3d != null) {
+			el.toggleClass("disabled", !obj3d.visible);
 			el.toggleClass("hidden", isHidden(obj3d));
 			var tog = el.find(".visibility-toggle").first();
 			if(tog.length == 0) {

+ 21 - 6
hrt/prefab/l3d/MeshGenerator.hx

@@ -72,6 +72,7 @@ class MeshGenerator extends Object3D {
 	public var root : MeshPart;
 
 	#if editor
+	static var filterInit = false;
 	static var filter : Array<String> = [];
 	static var customScene : h3d.scene.Scene;
 	#end
@@ -143,23 +144,30 @@ class MeshGenerator extends Object3D {
 	}
 
 	function createMeshPart( ctx : Context, mp : MeshPart, parent : h3d.scene.Object ) {
+
+		#if editor
+		if( mp.previewPos ) {
+			if( mp.isRoot() )
+				parent.addChild(createPreviewSphere());
+			else {
+				var socket = getSocket(parent, mp.socket);
+				if( socket != null )
+					socket.addChild(createPreviewSphere());
+			}
+		}
+		#end
+
 		if( mp.meshPath == null )
 			return;
 
 		var obj = ctx.loadModel(mp.meshPath);
 		if( mp.isRoot() ) {
 			parent.addChild(obj);
-			#if editor
-			if( mp.previewPos ) parent.addChild(createPreviewSphere());
-			#end
 		}
 		else {
 			var socket = getSocket(parent, mp.socket);
 			if( socket != null ) {
 				socket.addChild(obj);
-				#if editor
-				if( mp.previewPos ) socket.addChild(createPreviewSphere());
-				#end
 			}
 		}
 
@@ -443,6 +451,13 @@ class MeshGenerator extends Object3D {
 		super.edit(ctx);
 
 		var families : Array<Dynamic> = ctx.scene.config.get("meshGenerator.families");
+
+		if( !filterInit ) {
+			for( f in families )
+				filter.push(f);
+			filterInit = true;
+		}
+
 		var s = '<div class="group" name="Filter"><dl>';
 		for( f in families )
 			s += '<dt>${f}</dt><dd><input type="checkbox" class="${families.indexOf(f)}"/></dd>';