<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2-ppt DokuWiki" -->
<?xml-stylesheet href="/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="/feed.php">
        <title>Documentation Center public:dson_spec:object_definitions:formula</title>
        <description></description>
        <link>/</link>
        <image rdf:resource="/lib/tpl/dazdoccenter/images/favicon.ico" />
       <dc:date>2026-04-14T10:03:42+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="/public/dson_spec/object_definitions/formula/start"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="/lib/tpl/dazdoccenter/images/favicon.ico">
        <title>Documentation Center</title>
        <link>/</link>
        <url>/lib/tpl/dazdoccenter/images/favicon.ico</url>
    </image>
    <item rdf:about="/public/dson_spec/object_definitions/formula/start">
        <dc:format>text/html</dc:format>
        <dc:date>2012-05-22T22:40:34+00:00</dc:date>
        <title>formula</title>
        <link>/public/dson_spec/object_definitions/formula/start</link>
        <description>
&lt;h1 id=&quot;formula&quot;&gt;formula&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;/div&gt;

&lt;h2 id=&quot;description&quot;&gt;Description&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
Describes a set of operations and relationships to apply to a given property in the scene.
&lt;/p&gt;

&lt;/div&gt;

&lt;h2 id=&quot;parent_objects&quot;&gt;Parent Objects&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/dson_spec/object_definitions/modifier/start&quot; class=&quot;wikilink1&quot; title=&quot;public:dson_spec:object_definitions:modifier:start&quot;&gt;modifier&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/dson_spec/object_definitions/node/start&quot; class=&quot;wikilink1&quot; title=&quot;public:dson_spec:object_definitions:node:start&quot;&gt;node&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;properties&quot;&gt;Properties&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;div class=&quot;table sectionedit1&quot;&gt;&lt;table class=&quot;inline&quot;&gt;
	&lt;thead&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0&quot;&gt; Name &lt;/th&gt;&lt;th class=&quot;col1&quot;&gt; Description &lt;/th&gt;&lt;th class=&quot;col2&quot;&gt; Default &lt;/th&gt;&lt;th class=&quot;col3&quot;&gt; Required &lt;/th&gt;
	&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; output &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; A string representing the object reference of the single-valued property to be targeted with the output from the formula. &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; None &lt;/td&gt;&lt;td class=&quot;col3&quot;&gt; yes &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; operations &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; An ordered array of &lt;a href=&quot;/public/dson_spec/object_definitions/operation/start&quot; class=&quot;wikilink1&quot; title=&quot;public:dson_spec:object_definitions:operation:start&quot;&gt;operation&lt;/a&gt; objects to apply, to derive the output value. &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; None &lt;/td&gt;&lt;td class=&quot;col3&quot;&gt; yes &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; stage &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; A string representing the calculation stage that this formula’s output contributes to.  May be one of “multiply” or “sum”.  See &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/dson_spec/object_definitions/formula/start#details&quot; class=&quot;wikilink1&quot; title=&quot;public:dson_spec:object_definitions:formula:start&quot;&gt;Details&lt;/a&gt;&lt;/span&gt; section. &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; “sum” &lt;/td&gt;&lt;td class=&quot;col3&quot;&gt; no &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;!-- EDIT1 TABLE [308-885] --&gt;
&lt;/div&gt;

&lt;h2 id=&quot;details&quot;&gt;Details&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
The operations are given in &lt;a href=&quot;https://en.wikipedia.org/wiki/Reverse_Polish_notation&quot; class=&quot;interwiki iw_wp&quot; target=&quot;_blank&quot; title=&quot;https://en.wikipedia.org/wiki/Reverse_Polish_notation&quot; rel=&quot;noopener&quot;&gt;Reverse Polish Notation&lt;/a&gt; (RPN) and applied in order.  The output is the top-level operand remaining on the stack after applying all operations.
&lt;/p&gt;

&lt;p&gt;
The &lt;em&gt;operations&lt;/em&gt; array must contain at least one push operator and there must be at least one operand remaining on the stack at the end of the operation sequence, which will be pushed to the target channel.  If the stack contains insufficient entries for a given operator, the results of that operator are undefined.
&lt;/p&gt;

&lt;p&gt;
Multiple formulas may output to the same property, and if they do there must be some logic to determine how the results will be accumulated onto the property.  The &lt;em&gt;stage&lt;/em&gt; element allows a formula to specify how its &lt;em&gt;output&lt;/em&gt; will be combined with other outputs that may target the same property.  The current implementation supports a two-stage combiner.  The outputs for all formulas that specify “multiply” as their stage will be multiplied together and the result multiplied by the sum of the outputs of all formulas that specify “sum” as their stage.
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;output = (sum1+sum2+sum3+...sumN) * multi1 * multi2 * multi3 *...*multiN&lt;/pre&gt;

&lt;p&gt;
More stages may be introduced in the future to support more complex combinations of outputs.
&lt;/p&gt;

&lt;/div&gt;

&lt;h2 id=&quot;example&quot;&gt;Example&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;pre class=&quot;code&quot;&gt;{
    &amp;quot;output&amp;quot; : &amp;quot;upper_leg:figures/Unimesh#upper_leg?rotation/x&amp;quot;,
    &amp;quot;operations&amp;quot; : [
        { &amp;quot;op&amp;quot; : &amp;quot;push&amp;quot;, &amp;quot;url&amp;quot; : &amp;quot;hips:figures/UniMesh#hips?rotation/x&amp;quot; },
        { &amp;quot;op&amp;quot; : &amp;quot;push&amp;quot;, &amp;quot;url&amp;quot; : &amp;quot;hips:figures/Daphne#DaphneHeadLarge?value&amp;quot; },
        { &amp;quot;op&amp;quot; : &amp;quot;push&amp;quot;, &amp;quot;val&amp;quot; : 1.7 },
        { &amp;quot;op&amp;quot; : &amp;quot;add&amp;quot; },
        { &amp;quot;op&amp;quot; : &amp;quot;mult&amp;quot; },
    &amp;quot;stage&amp;quot; : &amp;quot;multiply&amp;quot;
    ]
}&lt;/pre&gt;

&lt;/div&gt;
</description>
    </item>
</rdf:RDF>
