question about DSON File Format , formula "stage"

kitakoredazkitakoredaz Posts: 3,526
edited December 1969 in Daz Studio Discussion

now there are three files FBMhogehoge.dsf , PHMhogehoge.dsf, and MCMhogehoge.dsf

this is sample code of fomulas (modifierlibrary) of MCMhogehoge.dsf

===========================================================

//"formulas" : [
{//(fourmula 1)
"output" : "Genesis:#MCMHogehoge?value",//(output 1)
"operations" : [
{ "op" : "push", "url" : "PHMhogehoge.dsf#PHMhogehoge?value" },//(op1)
{ "op" : "push", "val" : 1 },//(op2)
{ "op" : "mult" }//(op3)
]
},//(fomula1 end)

{//(fourmula 2)
"output" : "Genesis:#MCMHogehoge?value",//(output 2)
"stage" : "mult",(//stage1 ??)
"operations" : [
{ "op" : "push", "url" : "FBMHogehoge?value" }
]
}
]//(fourmula 2 end)

===============================================================
daz document say,
The forumula operations are given in Reverse Polish Notation,

then I think, foumula1 means,

op1 "push">>
stuck1="value of PHMhogehoge.dsf#PHMhogehoge.dsf"

op2 "push">>
stuck1= "value=1" , stuck2="value of PHMhogehoge.dsf#PHMhogehoge?value"

op3 "mult">>
stuck1(value)*stuck2(value)
= 1 * value of PHMhogehoge.dsf#PHMhogehoge?value

stuck1= value of PHMhogehoge.dsf#PHMhogehoge?value

output1
input stuck1(value) to "Genesis:#MCMHogehoge?value",

now
"Genesis:#MCMHogehoge?value"="PHMhogehoge.dsf#PHMhogehoge?value"


then
what "stage" means in fomula 2, and what fomula2 means?

I read dson document, but I can not grasp how they formula
about "stage" , and about fomula2.

may someone guide me?

or tell me the place where I can ask about DSON scripts?

Comments

  • Kendall SearsKendall Sears Posts: 2,995
    edited September 2012

    now there are three files FBMhogehoge.dsf , PHMhogehoge.dsf, and MCMhogehoge.dsf

    this is sample code of fomulas (modifierlibrary) of MCMhogehoge.dsf

    ===========================================================

    //"formulas" : [
    {//(fourmula 1)
    "output" : "Genesis:#MCMHogehoge?value",//(output 1)
    "operations" : [
    { "op" : "push", "url" : "PHMhogehoge.dsf#PHMhogehoge?value" },//(op1)
    { "op" : "push", "val" : 1 },//(op2)
    { "op" : "mult" }//(op3)
    ]
    },//(fomula1 end)

    {//(fourmula 2)
    "output" : "Genesis:#MCMHogehoge?value",//(output 2)
    "stage" : "mult",(//stage1 ??)
    "operations" : [
    { "op" : "push", "url" : "FBMHogehoge?value" }
    ]
    }
    ]//(fourmula 2 end)

    ===============================================================
    daz document say,
    The forumula operations are given in Reverse Polish Notation,

    then I think, foumula1 means,

    op1 "push">>
    stuck1="value of PHMhogehoge.dsf#PHMhogehoge.dsf"

    op2 "push">>
    stuck1= "value=1" , stuck2="value of PHMhogehoge.dsf#PHMhogehoge?value"

    op3 "mult">>
    stuck1(value)*stuck2(value)
    = 1 * value of PHMhogehoge.dsf#PHMhogehoge?value

    stuck1= value of PHMhogehoge.dsf#PHMhogehoge?value

    output1
    input stuck1(value) to "Genesis:#MCMHogehoge?value",

    now
    "Genesis:#MCMHogehoge?value"="PHMhogehoge.dsf#PHMhogehoge?value"


    then
    what "stage" means in fomula 2, and what fomula2 means?

    I read dson document, but I can not grasp how they formula
    about "stage" , and about fomula2.

    may someone guide me?

    or tell me the place where I can ask about DSON scripts?

    The first thing is to get a good grasp on RPN:
    http://en.wikipedia.org/wiki/Reverse_Polish_notation or
    http://ja.wikipedia.org/wiki/RPN

    Kendall

    Post edited by Kendall Sears on
  • kitakoredazkitakoredaz Posts: 3,526
    edited December 1969

    I read and grasped a litte about RPN in wiki.
    your link is same as what I serched in my native language.

    if you tell me where I misunderstanding in formula about RPN
    I may understand.

    but If you just show link and documentation I need not at all.
    so you need not answer me.

    I do not need so many knowledge about RPN when just tweak dsf files.

    because, I just want to know simple principal of dson formula.
    for make some jcm and phm as same as make simple code of js, or vsb.
    just want to know some DSON formula and basic principals.

    it is not difficult at all, if there are good doucuments to lern simple code.

    I think DAZ just make documents for programmer.

    so some products of vendor everytime cause erroer in log file
    about DSON formula.

  • Kendall SearsKendall Sears Posts: 2,995
    edited December 1969

    I read and grasped a litte about RPN in wiki.
    your link is same as what I serched in my native language.

    if you tell me where I misunderstanding in formula about RPN
    I may understand.

    but If you just show link and documentation I need not at all.
    so you need not answer me.

    I do not need so many knowledge about RPN when just tweak dsf files.

    because, I just want to know simple principal of dson formula.
    for make some jcm and phm as same as make simple code of js, or vsb.
    just want to know some DSON formula and basic principals.

    it is not difficult at all, if there are good doucuments to lern simple code.

    I think DAZ just make documents for programmer.

    so some products of vendor everytime cause erroer in log file
    about DSON formula.


    I provided those links as a way to guarantee a common starting point. Under the best of situations RPN is challenging for the average programmer. Unless one started with it, RPN is very counter intuitive.

    You were asking specifically about the formula portion of the DSON format. That portion is heavily reliant on RPN paradigms.

    In summary, any values that are to be used in any calculation must be final, available, and static before the target operation can occur. In the final result, infix calculations operate exactly as postfix operations, it's just that the compiler handles the parsing instead of the programmer. In the case where the information is unavailable for the output of a compiler, a crash occurs. With postfix, a crash is less likely because the parser can more deliberately tell if the information is available before the operation is executed. So, for a postfix operation involving a function that is providing a value, that function must be atomic and complete so that the discreet value can be provided onto the stack for the target operation to use. Otherwise, the interpretation of the script will stop (whether for additional input or script termination is up to the programmer).

    So, in the case of a DSON file, one must specify the location of the value(s) atomically so that the parser can complete the operation. Just remember that the value must be available BEFORE one makes a call to use it. Therefore, one must make sure that values that a specific function is dependent upon are complete and static before one makes a call to the dependent function.

    I hope that I have been of some help here.

    Kendall

  • kitakoredazkitakoredaz Posts: 3,526
    edited December 1969

    so would you tell me where I made mistake to get out-put answer "value" in fomula 1?
    or I missunderstand about "out-put" property?

    I do not feel it is important for me (though it is improtant for people who want to know more detail)
    that in fact "pop" value from stuck to register before calculate them, then after calculate throw back to stuck1,

    so just say about stuck1 , stuck2., stuck3

    I understand it like that

    if "push "new value , box on "stuck1 position" moved to "stuck2 position
    and push the value in box on "stuck 1 positon". eg) moving box from right to left on beltconvear

    then if input "operation", (eg plus, multi)
    calculate operands of stuck 1 and stuck2 with opereation then throw the value in stuck1 again.

    if there was box on stuck3 positon, they move to stuck2 position with value.

    finally output the operated value to destination "output property".

    and I can only calculate the value on stuck 1 and, stuck2,

    usually I can not calculete three values in same time,

    is it wrong understanding?

  • JimmyC_2009JimmyC_2009 Posts: 8,891
    edited December 1969

    Have you read these documnets, I don't know if they will help or not?

    http://docs.daz3d.com/doku.php/public/dson_spec/start

  • kitakoredazkitakoredaz Posts: 3,526
    edited September 2012

    of course this code is changed the "url" property of real products morph .dsf
    to show here. (it can run without problem)

    actually say, I have made some ctrl face morph and phm for face expression in pose controls
    from my handmade FBM, these days by tweaking dsf code directly.

    they can move correctly and what I hope.

    but when I checked them in log file, I found some files of products morph cause some bug in log file
    about fomula.

    I checked the product version but the products have not updated.

    so I need to check the dsf code for study new dson. and hope to make bug report about this.

    I want to know about how to use "stage" in fomula.and if I misunderstand about "out-put" ,
    or way to get the value for out put , I hope to know where I mistake.

    and Jimmy thanks,

    but I read the documents before ask here.again and again. I can not understand what stage means.
    and the code of above seems different in way to use it.
    because there is only sample code, but there is no guide how they calculate and chenge the value.

    =================================

    Just remember that the value must be available BEFORE one makes a call to use it. Therefore, one must make sure that values that a specific function is dependent upon are complete and static before one makes a call to the dependent function.

    if the value you say should be available is that?

    "channel" : {
    "id" : "value",
    "label" : "hogehoge",
    "visible" : false,
    "locked" : false,
    "min" : 0,
    "max" : 1,
    "clamped" : true,
    "display_as_percent" : false,
    "step_size" : 0.01,
    "value" : 0,
    "auto_follow" : false
    }

    I thought they call the value of channel property "value" which discribed above formula section.

    or if there need another value , this code of products seems mistake .
    but this file did not turn erroer in log files. the file of erroer message is another one.

    Now I think it is better just report of erroer with actual file to daz bug tracker.
    I do not think they will correct it but, why daz products cause erroer in fomula?

    DAZ decide the dson, and they know how to use it. but the products cuase fomula erroer,
    and they do not check it. do not you think it is real funny?

    Post edited by kitakoredaz on
  • Kendall SearsKendall Sears Posts: 2,995
    edited September 2012

    of course this code is changed the "url" property of real products morph .dsf
    to show here. (it can run without problem)

    actually say, I have made some ctrl face morph and phm for face expression in pose controls
    from my handmade FBM, these days by tweaking dsf code directly.

    they can move correctly and what I hope.

    but when I checked them in log file, I found some files of products morph cause some bug in log file
    about fomula.

    I checked the product version but the products have not updated.

    so I need to check the dsf code for study new dson. and hope to make bug report about this.

    I want to know about how to use "stage" in fomula.and if I misunderstand about "out-put" ,
    or way to get the value for out put , I hope to know where I mistake.

    and Jimmy thanks,

    but I read the documents before ask here.again and again. I can not understand what stage means.
    and the code of above seems different in way to use it.
    because there is only sample code, but there is no guide how they calculate and chenge the value.

    =================================

    Just remember that the value must be available BEFORE one makes a call to use it. Therefore, one must make sure that values that a specific function is dependent upon are complete and static before one makes a call to the dependent function.

    if the value you say should be available is that?

    "channel" : {
    "id" : "value",
    "label" : "hogehoge",
    "visible" : false,
    "locked" : false,
    "min" : 0,
    "max" : 1,
    "clamped" : true,
    "display_as_percent" : false,
    "step_size" : 0.01,
    "value" : 0,
    "auto_follow" : false
    }

    I thought they call the value of channel property "value" which discribed above formula section.

    or if there need another value , this code of products seems mistake .
    but this file did not turn erroer in log files. the file of erroer message is another one.

    Now I think it is better just report of erroer with actual file to daz bug tracker.
    I do not think they will correct it but, why daz products cause erroer in fomula?

    DAZ decide the dson, and they know how to use it. but the products cuase fomula erroer,
    and they do not check it. do not you think it is real funny?

    The stage is to allow for specifying how multiple changes to the same property are to be handled.

    Let's say you have a property called "foobar" and 3 formula that output to it. Let's also say that we have 2 formula for "barsoom."

    f1 {
    "output" : "foobar"
    "operations" : [
    lots of code here
    final value = 2
    "stage" : "sum"
    ]
    }

    f2 {
    "output" : "foobar"
    "operations" : [
    lots of code here
    final value = 3
    "stage" : "sum"
    ]
    }

    f3 {
    "output" : "foobar"
    "operations" : [
    lots of code here
    final value = 4
    "stage" : "multiply"
    ]
    }

    f4 {
    "output" : "barsoom"
    "operations" : [
    lots of code here
    final value = 5
    "stage" : "multiply"
    ]
    }

    f5 {
    "output" : "barsoom"
    "operations" : [
    lots of code here
    final value = 6
    "stage" : "multiply"
    ]
    }

    At the end of the script all of the "stages" will be combined for common properties based on the stage indicated. So, for "foobar" we will end up with (2+3)*4 as our final result, and barsoom will be (5*6). Each property has its own independent stages that determine the final result.

    Hopefully, I've not made a critical error in my explanation, it's been a long night...

    Kendall

    Post edited by Kendall Sears on
  • kitakoredazkitakoredaz Posts: 3,526
    edited September 2012

    Mr Kendall

    just say so many many many many thank you. and please care your health.

    I am sorry (I do not want to sorry manytimes ,,,,but need to say you) for frastrated about DSON and some files.

    now I have not full time carefully study which you explained for me and them into my brain correctly,
    so If I reply and ask you again now , I would mistake .

    I should check your guide again with carefully one by one. I thank so muck you.

    please do not care my rude attitude. if I have more knowledge about dson,
    I would ask you here.

    ==================================

    oh,, now I have some more quesiton,, so if you have time to reply, (not need soon,, when you have time,,may be not? @@;)

    one is about order,,

    if I change order f1 f2 f3 f4 f5 ,
    the final value would be change? or sometimes turn erroer message?

    eg if I order ,about output foober

    f1 {
    “output” : “foobar”
    “operations” : [
    lots of code here
    final value = 3
    “stage” : “sum”
    ]
    }

    f2 {
    “output” : “foobar”
    “operations” : [
    lots of code here
    final value = 4
    “stage” : “multiple”
    ]
    }

    f3 {
    “output” : “foobar”
    “operations” : [
    lots of code here
    final value = 2
    “stage” : “sum”
    ]
    }

    I think f1 and f3 will be combiend by stage "sum"
    so,,

    {(3 ,2)(sum) , (4)}(multiple)
    (3+2) *4
    foovar = 5 * 4 ?

    then I think If I hope to get fomula
    final foobar value=(2 +3) + (3 * 4)+ 7

    I must need ,, like that?
    f1 {
    “output” : “foobar”
    “operations” : [
    some code,(2 + 3)
    final value = (5)
    “stage” : “sum”
    ]
    }

    f2 {
    “output” : “foobar”
    “operations” : [
    some code,(3*4)
    final value = (12)
    “stage” : “sum”
    ]
    }

    f3 {
    “output” : “foobar”
    “operations” : [
    many code
    final value = (7)
    “stage” : “sum”
    ]
    }


    two is the reguration about how they combine for common properties based on the stage indicated.
    it means,

    first grouped what will output (in this case, foobar and barsoom)
    then they will be combined by same stage in the group?

    then now,,
    if there is code, like that,

    f1 {
    “output” : “foobar”
    “operations” : [
    code,
    final value = (2)
    “stage” : “multiple”
    ]
    }

    f2 {
    “output” : “foobar”
    “operations” : [
    final value = (12)
    “stage” : “sum”
    ]
    }

    foobar= {2(multiple) 12(sum)} =2*12 ?
    is it right?
    then it is better to think (sum) means just plus signe for a positive number?

    or turned erroer?

    Post edited by kitakoredaz on
  • Kendall SearsKendall Sears Posts: 2,995
    edited December 1969

    Mr Kendall

    just say so many many many many thank you. and please care your health.

    I am sorry (I do not want to sorry manytimes ,,,,but need to say you) for frastrated about DSON and some files.

    now I have not full time carefully study which you explained for me and them into my brain correctly,
    so If I reply and ask you again now , I would mistake .

    I should check your guide again with carefully one by one. I thank so muck you.

    please do not care my rude attitude. if I have more knowledge about dson,
    I would ask you here.

    Douitashimashite. Watashi wa nihongo wo sukoshi dake hanashimasu.

    Kendall

  • kitakoredazkitakoredaz Posts: 3,526
    edited December 1969

    ohh,,, please checked my edited,,,later,,,,, I hope,,

    I must work now,,, (should work,, not face on pc anymore,, )

  • Kendall SearsKendall Sears Posts: 2,995
    edited December 1969

    Mr Kendall

    just say so many many many many thank you. and please care your health.

    I am sorry (I do not want to sorry manytimes ,,,,but need to say you) for frastrated about DSON and some files.

    now I have not full time carefully study which you explained for me and them into my brain correctly,
    so If I reply and ask you again now , I would mistake .

    I should check your guide again with carefully one by one. I thank so muck you.

    please do not care my rude attitude. if I have more knowledge about dson,
    I would ask you here.

    ==================================

    oh,, now I have some more quesiton,, so if you have time to reply, (not need soon,, when you have time,,may be not? @@;)

    one is about order,,

    if I change order f1 f2 f3 f4 f5 ,
    the final value would be change? or sometimes turn erroer message?

    eg if I order ,about output foober

    f1 {
    “output” : “foobar”
    “operations” : [
    lots of code here
    final value = 3
    “stage” : “sum”
    ]
    }

    f2 {
    “output” : “foobar”
    “operations” : [
    lots of code here
    final value = 4
    “stage” : “multiple”
    ]
    }

    f3 {
    “output” : “foobar”
    “operations” : [
    lots of code here
    final value = 2
    “stage” : “sum”
    ]
    }

    I think f1 and f3 will be combiend by stage "sum"
    so,,

    {(3 ,2)(sum) , (4)}(multiple)
    (3+2) *4
    foovar = 5 * 4 ?


    so desu.


    then I think If I hope to get fomula
    final foobar value=(2 +3) + (3 * 4)+ 7

    Nai. Kore wa okorumasen. (Eigo) In DSON, all "sum" and all "multiply" will group together. So the above would become:

    (2+3+7) *3*4


    I must need ,, like that?
    f1 {
    “output” : “foobar”
    “operations” : [
    some code,(2 + 3)
    final value = (5)
    “stage” : “sum”
    ]
    }

    f2 {
    “output” : “foobar”
    “operations” : [
    some code,(3*4)
    final value = (12)
    “stage” : “sum”
    ]
    }

    f3 {
    “output” : “foobar”
    “operations” : [
    many code
    final value = (7)
    “stage” : “sum”
    ]
    }


    two is the reguration about how they combine for common properties based on the stage indicated.
    it means,

    first grouped what will output (in this case, foobar and barsoom)
    then they will be combined by same stage in the group?

    then now,,
    if there is code, like that,

    f1 {
    “output” : “foobar”
    “operations” : [
    code,
    final value = (2)
    “stage” : “multiple”
    ]
    }

    f2 {
    “output” : “foobar”
    “operations” : [
    final value = (12)
    “stage” : “sum”
    ]
    }

    foobar= {2(multiple) 12(sum)} =2*12 ?
    is it right?
    then it is better to think (sum) means just plus signe for a positive number?

    or turned erroer?

    All "sum" stages will be grouped and then multiplied by the "multiply" stages.

    (sum(1)+sum(2)+sum(3)....+sum(n)) * mult(1) * mult(2) * mult(3) ... * mult(n)

    Kendall

  • kitakoredazkitakoredaz Posts: 3,526
    edited December 1969

    ookini !! honma tasukaru!

    (this is my dialect word ,, so may you ask some one)

    your explanation is so helpful and I think I can understand parts of DSON and stage,,

    I will plan to learm about more basic as you said before,,
    (though it may cause me panic ,, "register" value to somewhere,,,)

    out of topic,,
    as you know my engilsh is broken,,,
    when I was a barman , I had stayed in small town of UK some months,,
    and traveled from place to place for lerning "pub" beer and whiskeys in scothish , irish.,,

    but I like,, rose of texsas,,bourbon,,,or c.c,,silk tussel,, canadians,,

    oh,, what I talked about,,?!
    hope we get Angel's share some day, somewhere.

Sign In or Register to comment.