Results 1 to 6 of 6

Thread: maya's 'in-between' morphing

  1. #1

    maya's 'in-between' morphing

    Hi,

    There is a type of morphing in Maya where you can setup a 'list' of targets. They call it 'in-between'. This works by blending in series, rather than blending in parallel (as the current COLLADA spec supports).

    The result of the morph is only ever done between the current target and the next target in the list. The choice of what defines the current and the next is determined by a value which you can assign to each target.

    e.g.

    targetA 0
    targetB 0.5
    targetC 0.8
    targetD 1.0

    an input value of 0.2 would result in a morph between targetA and targetB only.
    an input value of 0.6 would result in a morph between targetB and targetC only.

    The morph is linear so that 0.2 would result in a linear blend between targetA and targetB, where 0 and 0.5 are effectively mapped to 0 and 1, and 0.2 is effectively mapped into this range (to something around 0.5).

    Does COLLADA already support this type of morphing?
    OR will this type of morphing supported in the future?

    I need to know from within COLLADA which type of morphing has been setup, so I can use a different import path in our tools.

    We need to support this type of morphing now, and I am deciding if I should follow the official method (if there is one), or if I should extend the collada spec myself (with appropiate tags under an appropiate <extra> tag).

    Quote from Maya help:

    "In-Between

    Specifies whether the blending will be in series or in parallel.

    If on, the blending will be in series. Shape transitions will occur in the order in which you selected the target shape(s). The effect will be that the blend shape will be able to change from the first target object shape, to the second, and so on, back and forth through the series of target object shapes chained together as "in-between" shapes.

    "

  2. #2
    Senior Member
    Join Date
    Aug 2005
    Location
    California
    Posts
    165
    It seems that with a little bit of trickery you can make parallel blending work as "in-between" blending.

    In COLLADA we use the parallel model. We have X number of blend shapes, and X floating point numbers for blend weights. The "in-between" can be implemented as using weights appropriate for the time and 0 for all others. heres an example to hopefully make that clearer
    Code :
    Shapes    ->  TA     TB    TC    TD
    Maya vals ->   0     0.5   0.8   1.0
    for a value of .5 the COLLADA weights would look like
    COLLADA  ->    0      1      0      0
    for a value inbetween "keys" you would need to do some interpolation.
    for a value 0.9 you would get
    COLLADA  ->    0      0      0.5   0.5
    So in theory that will work fine. But I don't know how Maya will export that data. And how Maya will export animations for that data. However they do it I'm sure there is a way to message it into something usable (as long as all the data is there). If not you will need to make a request to the plugin developers to get the information needed to export, or do it yourself since it is opensource.

    -Andy

  3. #3
    Senior Member
    Join Date
    Jul 2004
    Location
    Santa Clara
    Posts
    356
    ... and if you have the possibility, you can also contract Feeling software to take care of this for you and all other COLLADA users !

  4. #4
    Quote Originally Posted by alorino
    It seems that with a little bit of trickery you can make parallel blending work as "in-between" blending.

    In COLLADA we use the parallel model. We have X number of blend shapes, and X floating point numbers for blend weights. The "in-between" can be implemented as using weights appropriate for the time and 0 for all others. heres an example to hopefully make that clearer
    Code :
    Shapes    ->  TA     TB    TC    TD
    Maya vals ->   0     0.5   0.8   1.0
    for a value of .5 the COLLADA weights would look like
    COLLADA  ->    0      1      0      0
    for a value inbetween "keys" you would need to do some interpolation.
    for a value 0.9 you would get
    COLLADA  ->    0      0      0.5   0.5
    So in theory that will work fine. But I don't know how Maya will export that data. And how Maya will export animations for that data. However they do it I'm sure there is a way to message it into something usable (as long as all the data is there). If not you will need to make a request to the plugin developers to get the information needed to export, or do it yourself since it is opensource.

    -Andy
    It appears from a little testing that both the Max and Maya plugins will export in-between style morphing as parallel morphs.

    But, I need to treat in-between (or progressive as it is called in Max) as a special morph case for our engine so would like a special structure in the Collada file to represent this case.

    Both max and maya allow each target to have in-betweens, so that you can mix inbetweens and parallel, but I'm not interested in that.
    I am only interested in a single in-between style morph which does:
    A->B->C for example.

  5. #5
    Quote Originally Posted by remi
    ... and if you have the possibility, you can also contract Feeling software to take care of this for you and all other COLLADA users !
    I'm happy to do the work on our modified version of both the max and maya plugins

    I have looked at the collada specification and it seems the best (and only?) way to implement this within the scope of collada is to put an <extra> tag within <instance_geometry> and put all our special stuff in there. To me this makes good sense for what we want.

    I thought about other places to put this information and this is what prevented me from putting it into other places.

    - I can't use <extra> under <controller> because it must have a <morph> or <skin> tag. I am forced to make a choice because there is no way to have your own controller types. But if I do this it is confusing what I am trying to represent unless I choose <morph>

    - using <morph> seemed a good idea, but with this the morph method is forced to be NORMALIZED or RELATIVE and in addition there are mandatory child tags under that which don't exactly fit in with what I had decided.

    So this is what I am proposing for us, and if the collada spec is updated for it, then that would be great, but if not, no worries as we have what we need

    <instance_geometry ... >
    <extra>
    <technique profile=".." >
    <-- names of the target geometry -->
    <source id="morph-targets"> ... <name_array>targetA targetB targetC</name_array> .. </source>
    <-- values at which each target is at 100% effect -->
    <source id="morph-active-weights"><float_array>...... 0 0.5 1.0 .... </float_array></source>
    <target>
    <input semantic="MORPH_TARGET" source="#morph-targets"/>
    <input semantic="MORPH_ACTIVE_WEIGHT" source="#morph-active-weights"/>
    <-- this is the value which controls the blending and can be referenced in animation -->
    <morph_weight>0</morph_weight>
    </technique>

    </exta>
    </instance_geometry>

    note: some elements not included.

  6. #6
    Senior Member
    Join Date
    Aug 2004
    Location
    California
    Posts
    771
    Quote Originally Posted by kevt
    - I can't use <extra> under <controller> because it must have a <morph> or <skin> tag. I am forced to make a choice because there is no way to have your own controller types. But if I do this it is confusing what I am trying to represent unless I choose <morph>
    Perhaps if you do <extra type="morph"> ... it would be clear enough?

    What about <instance_controller>?

    Does your information really belong with the geometry? or the controller? or the instance of either of those?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •