Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   Transfer Poses to other models (http://www.alice.org/community/showthread.php?t=487)

MiR 11-12-2006 06:07 AM

Transfer Poses to other models
 
Hi, I am new to Alice but a fairly expierienced Programmer.
My question is a very simple one: Is there any possibility to speed up the process of building poses by transfering the pose information to other modells of a structurally identical type (from one He-Builder based model to another etc.)?
The workaround can be based on internal or external tools anyhow.
I found out, that the exported objects are saved as a zipped struture of xmls, so maybe there is a way by unzipping the models info, copying the desired poses and rezipping the model into a new one. But as I don't have time to analyse the structure in detail, maybe the programmers can help with a clue?
Has anyone tried such an approach?
The background for this is, that I am trying to do some movie work (thinking of machinima or so) with Alice and this limitation produces work where no work should be needed.
As far as I understand, this feature remains unimplemented due to the educational approach Alice is dedicated to. But maybe there is an external tool anywhere around for cases like this?

Thx for help
Michael

MiR 11-12-2006 07:06 AM

Transfering is possible in general
 
1 Attachment(s)
Ok, I tried this and actually this works out quite fine.
To transfer the poses and methods between equivalent models (he to she or so) the following procedure worked for me:
1. Save the models as a2c to disk
2. rename the models to .zip
3. unzip the models to different folders
4. copy the changed/additional folders from the source model to destination model
5. change in the rootfolder of the model the file elementData.xml with an editor.
Here we have to change
a) the child elements: add the missing methods/poses
<child filename="sitting">
b) the missing item elements named
<item criterionClass="edu.cmu.cs.stage3.alice.core.criterion.InternalReferenceKeyedCriterion">methodname</item>
6 save the elementdata.xml
c) Change the element poses accordingly, otherwise the poses will not show up in the properties page (though they will work properly:-)
<property componentClass="edu.cmu.cs.stage3.alice.core.Pose" name="poses">
<item criterionClass="edu.cmu.cs.stage3.alice.core.criterion.InternalReferenceKeyedCriterion">sitting</item>
</property>

7. Zip the file and path structure back into a zip file
8. Rename that into a2c and put it into the alice gallery path

Voila, your new model is now a trained person

Next thing to try is, if this works also to structural only partly equivalent models. Perpare for crashes :D

The Attached file is an POC example. The poses and methods standup/sitdown where originally defined for Mary, a She-Builder model, then copied with the explained method to Karl, a He-Builder model.

thetrippster 11-12-2006 11:50 AM

wow my brain hurts:confused: :D umm just wait for dr jim to respond he knows more than me

DrJim 11-12-2006 12:04 PM

Great Work
 
My brain - and [I]some[/I] of the other parts of my body I've been acused of thinking with - hurt also. :p But it's a good hurt. :D

Thanks MiR :) - you've made a great start on something some of us have wanted to do for a while. In my case, never really could get through of the details of the xmls file - could just decipher enough of it to know there was real potential there.

DrJim 11-12-2006 08:39 PM

Quick Note
 
1 Attachment(s)
Very brief note and something you may already have tried.

I knew this worked for the figures provided with Alice and just verified it worked for your added pose. If you have one figure of a type with a pose, any very similar figure (i.e., any based on shebuilder) can use that pose, although the pose will only be listed for the initial figure (see screen shots).

If you try to use a figure with a structure missing some of the parts involved (say the Ninja in this case), Alice gives an error. Not sure how close the figures have to be for the sharing of poses to work but I'm running some trial cases.

MiR 11-18-2006 07:13 AM

Hi DrJim,

I already noticed, that you can use poses on foreign models by implementing an object variable on the classmethods in the class that owns the poses, like the birdmodel in the gallery does. But this approach implies that you have to implement at least one model of the pose-owning class anywhere in the scene.
This means, if Karl should use the poses, Mary has defined, you have to use Mary and uses her poses on Karl. This will result in problems, if you don't want to use Mary at all in the scene. And, of course, the constraints you mentioned imply on this, you only can use structural similar (mostly identical...) models.
On the other hand, the xml-based approach in fact also is only usable on similar models, because the xml-structure is very complicated and changes have to be well defined or Alice will blow up the whole thing.
If you for example try to use leftforearm poses on a part called leftarm you will have to rename some directories, make changes to half a dozen xml-files and check the hierarchy by hand. Not a very effizient approach.:(

Maybe the whole thing isn't very much more than a proof of concept.

DrJim 11-18-2006 12:06 PM

Some Comments
 
2 Attachment(s)
First, these comments are aimed towards moderately experienced programmers using Alice for animated videos - not beginning CS students. I [I]strongly[/I] support keeping the Alice focus on the latter group. However, as a filmmaker I find Alice to be such a useful tool that I feel it would be a shame not to try to improve its usefulness in that area as well.

[I]"…. you have to implement at least one model of the pose-owning class anywhere in the scene."[/I]

Given the way Alice 2.0 implements "inheritance" - I'm not sure this is bad. I personally would just as soon have only one object in Alice with the added poses and methods - this way when something is changed, I don't have to recreate a large number of objects or try to remember which ones have the old method and which have the new.

[I]"And, of course, the constraints you mentioned imply … you only can use structural similar (mostly identical...) models " [/I]

I think the constraint is that you can use things that have the same hierarchy up to the named part - if that isn't true, nothing will work. If it is true, but other parts named in the original are not present - Alice usually will do the pose but throw an error message. I'm hoping this is just a syntax thing and putting a dummy part name in the top level xml file will solve the problem - but I haven't verified this yet. You can also get some interesting scaling problems - watch "Student1" explode if you use one of "Coach's" poses on him :eek: (going the other way can be funny too)- but that's true no matter how you share the poses.

[I]"Not a very efficient approach … Maybe the whole thing isn't very much more than a proof of concept."[/I]

It is time consuming, but - thanks to the great library of characters in Alice - making only slight changes to Gallery characters can be an efficient way to generate animated scenes. I hope you'll continue your efforts. :)

(To illustrate the last point, I've attached two shots of characters I'm currently using - "Mommy Dewey" and "Lady Grandma". Using "Grandma" it took less than an hour to animate a scene with her sitting on a park bench and looking around - including a shot that emphasized [I]you can see through her glasses[/I]. For reference, I've filmed the same scene live twice as an actor and both times it took about the same amount of time as I spent on the animation. ("Grandma" is a better actor, but I'm better looking - and [B]I[/B] control [B]her[/B] skin texture :D !))


All times are GMT -5. The time now is 04:47 AM.

Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.