color.xml 2.03 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
<OpenFlipper>

    <element name="color_backgound">
    <category>Colors</category>
    <short>Background Color</short>
    <dataflow>true</dataflow>
    <inputs>
      <input name="color" type="Vector">
        <short>Color</short>
        <long>Desired background color</long>
        <precision>0.00001</precision>
      </input>
    </inputs>
    <code>
	colorplugin.setBackgroundColor([input="color"])      
    </code>
  </element>

19

20
    <element name="color_object">
21
    <category>Colors</category>
22 23
    <short>Object Color</short>
    <long>Set Color of an object</long>
24 25 26 27 28 29
    <dataflow>true</dataflow>
    <inputs>
      <input name="obj" type="ObjectId">
        <short>ID</short>
        <long>ID of an object</long>
      </input>
30 31
      <input name="color_emissive" type="Vector4" optional="true">
        <short>Emissive</short>
32 33 34
        <long>Desired emissive color</long>
        <precision>0.00001</precision>
      </input>
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
      <input name="color_ambient" type="Vector4" optional="true">
        <short>Ambient</short>
        <long>Desired ambient color</long>
        <precision>0.00001</precision>
      </input>
      <input name="color_diffuse" type="Vector4" optional="true">
        <short>Diffuse</short>
        <long>Desired diffuse color</long>
        <precision>0.00001</precision>
      </input>
      <input name="color_specular" type="Vector4" optional="true">
        <short>Specular</short>
        <long>Desired specular color</long>
        <precision>0.00001</precision>
      </input>
50 51
    </inputs>
    <code>
52 53 54 55 56 57 58 59 60 61 62
        if ([is_connected="color_emissive"])
	  colorplugin.setObjectEmissiveColor([input="obj"],[input="color_emissive"]);

        if ([is_connected="color_ambient"])
	  colorplugin.setObjectAmbientColor([input="obj"],[input="color_ambient"]);

        if ([is_connected="color_diffuse"])
	  colorplugin.setObjectDiffuseColor([input="obj"],[input="color_diffuse"]);

        if ([is_connected="color_specular"])
	  colorplugin.setObjectSpecularColor([input="obj"],[input="color_specular"]);
63 64 65
    </code>
  </element>

66
</OpenFlipper>