From 543be9df3fc8da5ae50bc2aa9fa5c7a928ad20b5 Mon Sep 17 00:00:00 2001 From: mfranz Date: Fri, 21 Apr 2006 19:49:44 +0000 Subject: [PATCH] - make ufo import only static objects with a minimum of defined data - turn off specular on the sign placeholder model --- Aircraft/ufo/Models/sign.ac | 2 +- Aircraft/ufo/ufo.nas | 35 ++++++++++++++++++++++------------- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/Aircraft/ufo/Models/sign.ac b/Aircraft/ufo/Models/sign.ac index 201c5873c..f37680fc9 100644 --- a/Aircraft/ufo/Models/sign.ac +++ b/Aircraft/ufo/Models/sign.ac @@ -1,6 +1,6 @@ AC3Db MATERIAL "legend" rgb 1 1 1 amb 1 1 1 emis 1 1 1 spec 0 0 0 shi 72 trans 0 -MATERIAL "black" rgb 0.3 0.3 0.3 amb 0.3 0.3 0.3 emis 0 0 0 spec 1 1 1 shi 72 trans 0 +MATERIAL "black" rgb 0.3 0.3 0.3 amb 0.3 0.3 0.3 emis 0 0 0 spec 0 0 0 shi 72 trans 0 OBJECT world kids 3 OBJECT poly diff --git a/Aircraft/ufo/ufo.nas b/Aircraft/ufo/ufo.nas index 4e0585993..57d782d15 100644 --- a/Aircraft/ufo/ufo.nas +++ b/Aircraft/ufo/ufo.nas @@ -676,19 +676,28 @@ ModelMgr = { } }, import : func { - var models = props.globals.getNode("models", 1); - var tmp = props.Node.new(); - props.copy(models, tmp); - models.removeChildren("model"); - foreach (var m; tmp.getChildren("model")) { - append(me.static, Static.new(m.getNode("path").getValue(), - m.getNode("legend", 1).getValue(), - m.getNode("longitude-deg", 1).getValue(), - m.getNode("latitude-deg", 1).getValue(), - m.getNode("elevation-ft", 1).getValue(), - m.getNode("heading-deg", 1).getValue(), - m.getNode("pitch-deg", 1).getValue(), - m.getNode("roll-deg", 1).getValue())); + var mandatory = ["path", "longitude-deg", "latitude-deg", "elevation-ft"]; + foreach (var m; props.globals.getNode("models", 1).getChildren("model")) { + var ok = 1; + foreach (var a; mandatory) { + if (m.getNode(a) == nil or m.getNode(a).getType() == "NONE") { + ok = 0; + } + } + if (ok) { + var tmp = props.Node.new({"heading-deg":0, "pitch-deg":0, "roll-deg":0}); + prop.copy(m, tmp); + m.getParent().removeChild(m.getName(), m.getIndex()); + append(me.static, Static.new( + m.getNode("path").getValue(), + m.getNode("legend").getValue(), + m.getNode("longitude-deg").getValue(), + m.getNode("latitude-deg").getValue(), + m.getNode("elevation-ft").getValue(), + m.getNode("heading-deg").getValue(), + m.getNode("pitch-deg").getValue(), + m.getNode("roll-deg").getValue())); + } } me.select(); },