Commit 7c76bf5b authored by Marlin Frickenschmidt's avatar Marlin Frickenschmidt

Fixed a critical bug that made it impossible to use conditions or loops (is nobody using them? :P).

Added some visual scripting functions for Mesh Repair plugin.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@10784 383ad7c9-94d9-4d36-a494-682f7c89f535
parent facb35ca
......@@ -18,8 +18,8 @@
</function>
</functions>
<code>
while ([function="test"]().out)
[function="content"]()
while ([function="condition"]().out)
[function="content"]();
</code>
</element>
......@@ -29,7 +29,7 @@
<long>IF condition</long>
<dataflow>true</dataflow>
<inputs>
<input name="test" type="Bool" user="false">
<input name="condition" type="Bool" user="false">
<short>Test</short>
</input>
</inputs>
......@@ -42,7 +42,7 @@
</function>
</functions>
<code>
if ([input="test"])
if ([input="condition"])
[function="true"]();
else
[function="false"]();
......
<OpenFlipper>
<element name="repair_selectedgeslongerthan">
<category>Mesh Repair</category>
<short>Select long edges</short>
<dataflow>true</dataflow>
<inputs>
<input name="obj" type="ObjectId">
<short>ID of an object</short>
<long>ID of an object</long>
</input>
<input name="length" type="Number">
<short>Minimal edge length</short>
<long>Minimal length of edges that will be selected</long>
<min>0.0</min>
<max>100.0</max>
<precision>0.0001</precision>
</input>
</inputs>
<code>
meshrepair.selectEdgesLongerThan ([input="obj"], [input="length"]);
</code>
</element>
<element name="repair_selectedgesshorterthan">
<category>Mesh Repair</category>
<short>Select short edges</short>
<dataflow>true</dataflow>
<inputs>
<input name="obj" type="ObjectId">
<short>ID of an object</short>
<long>ID of an object</long>
</input>
<input name="length" type="Number">
<short>Maximal edge length</short>
<long>Maximal length of edges that will be selected</long>
<min>0.0</min>
<max>100.0</max>
<precision>0.0001</precision>
</input>
</inputs>
<code>
meshrepair.selectEdgesShorterThan ([input="obj"], [input="length"]);
</code>
</element>
<element name="repair_removeselected">
<category>Mesh Repair</category>
<short>Merge selected edges</short>
<dataflow>true</dataflow>
<inputs>
<input name="obj" type="ObjectId">
<short>ID of an object</short>
<long>ID of an object</long>
</input>
</inputs>
<code>
meshrepair.removeSelectedEdges ([input="obj"]);
</code>
</element>
<element name="repair_flipfaceorientation">
<category>Mesh Repair</category>
<short>Flips selected face normals</short>
<dataflow>true</dataflow>
<inputs>
<input name="obj" type="ObjectId">
<short>ID of an object</short>
<long>ID of an object</long>
</input>
</inputs>
<code>
meshrepair.flipOrientation ([input="obj"]);
</code>
</element>
<element name="repair_detectremoveskinnyangle">
<category>Mesh Repair</category>
<short>Detect/Repair skinny triangles by angle</short>
<dataflow>true</dataflow>
<inputs>
<input name="obj" type="ObjectId">
<short>ID of an object</short>
<long>ID of an object</long>
</input>
<input name="angle" type="Number">
<short>Minimal angle</short>
<long>Minimal angle between adjacent faces such that an edge is selected/flipped</long>
<min>0.0</min>
<max>180.0</max>
<precision>0.0001</precision>
</input>
<input name="remove" type="Bool">
<short>Flip found edges?</short>
<long>True if found sharp edges should be flipped, false to only select them</long>
</input>
</inputs>
<code>
meshrepair.detectSkinnyTriangleByAngle ([input="obj"], [input="angle"], [input="remove"]);
</code>
</element>
<element name="repair_detectflattriangles">
<category>Mesh Repair</category>
<short>Detect flat triangles</short>
<long>Detect flat triangles of valence 3</long>
<dataflow>true</dataflow>
<inputs>
<input name="obj" type="ObjectId">
<short>ID of an object</short>
<long>ID of an object</long>
</input>
<input name="angle" type="Number">
<short>Maximal angle</short>
<long>Maximal angle difference to adjacent triangles such that a triangle is selected</long>
<min>0.0</min>
<max>180.0</max>
<precision>0.0001</precision>
</input>
</inputs>
<code>
meshrepair.detectFlatTriangles ([input="obj"], [input="angle"]);
</code>
</element>
</OpenFlipper>
......@@ -519,7 +519,7 @@ Function* Context::parseFunction (QXmlQuery &_xml, Element *_e)
QString endCode = "return { ";
foreach (Input *i, f->end_->inputs ())
endCode += i->name () + " : '[input=\"" + i->name () + "\"]', ";
endCode += i->name () + " : [input=\"" + i->name () + "\"], ";
endCode.remove (endCode.length () - 2, 2);
endCode += " };\n";
......
......@@ -202,7 +202,7 @@ QScriptValue VsiPlugin::askForInputs(QString _element, QString _inputs)
QString script = "inputs = { ";
foreach (QString s, _inputs.split (",", QString::SkipEmptyParts))
script += s + ": '" + results[s] + "',";
script += s + ": " + results[s] + ",";
script.remove (script.length () - 1, 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment