Page 1 of 2

what kind of animations works atm?

PostPosted: Sun Dec 23, 2007 11:02 pm
by Goofy
like the subject says what kind? Is it just global animations that works or can we do puzzle animation. Like if the avie clicks on something which causes it to rotate a turn?

Was just curious. :roll:

Re: what kind of animations works atm?

PostPosted: Sun Dec 23, 2007 11:04 pm
by Paradox
Right now... no animation :P

You can do some really horrible, really slow animations with Python (rotations and simple translations).

Re: what kind of animations works atm?

PostPosted: Mon Dec 24, 2007 1:16 am
by Jennifer_P
Is that how the snowflakes in your Age work, Paradox? A sort of spiral down simultaneous translation/rotation...? And do you get any lag with that?

Re: what kind of animations works atm?

PostPosted: Mon Dec 24, 2007 1:54 am
by Paradox
No snowflakes yet. Those will be hacked together using the same particle systems as Cyan's Ages... I just need to figure out how those work >.>

Re: what kind of animations works atm?

PostPosted: Mon Dec 24, 2007 11:50 am
by Jennifer_P
Oh whoops, I thought I recalled seeing thinly falling flakes in your snow Age. Must've been my imagination. :)

Re: what kind of animations works atm?

PostPosted: Mon Dec 24, 2007 6:09 pm
by Tsar Hoikas
Actually... With a bit of Python and an Activator in your age, you can make an avatar go through a standard Cyan animation.

Code: Select all
from Plasma import *
from PlasmaTypes import *
from PlasmaConstants import *

Activator = ptAttribActivator(1, 'Activator: The clickable')
WarpPoint = ptAtrribSceneobject(2, 'SceneObject: Point object where avatar does animation')
AnimName = ptAttribString(3, 'String: Which animation?') #Check the GlobalAnimation_District_*.prp
                                                         #Leave out the gender type!!!

class xAnimateAvatar(ptModifier,):
    def __init__(self):
        self.id = 7770777
        self.version = 0
   
   
    def OnNotify(self, state, id, events):
        if(id == Activator.id and PtWasLocallyNotified(self.key)):
            avatar = PtGetLocalAvatar()
            #Make sure we are idle
            if (avatar.avatar.getCurrentMode() != PtBrainMode.kNonGeneric):
                PtDebugPrint('xAnimateAvatar.OnNotify():\tI am busy. Not animating.')
                return None
           
            #What kind of anim to run?
            if avatar.avatar.getClothingGroup() == kMaleClothingGroup:
                animString = 'Male' + AnimName.value
            else:
                animString = 'Female' + AnimName.value
           
            #Run the anim
            PtDebugPrint('xAnimateAvatar.OnNotify():\tRunning animation named ' +  animString)
            avatar.avatar.oneShot(WarpPoint.value.getKey(), 1, 1, animString, 0, 0)


As for documentation for this code:

You will need to provide 3 arguments in the plPythonFileMod for this script. First, you will have the ActivatorConditionalObject that acts as a toggle. You will then need a point object for where you want the avatar to stand when the animation is played. Finally, you will provide the name for the animation, which can be acquired by looking through the "GlobalAnimation_District_*.prp" prp files. You should not include the gender name. For example, if I wanted to to run the "MaleGroundImpact" or "FemaleGroundImpact" animation, then I would specify "GroundImpact" as the animation name.

Hope that makes sense :)

Re: what kind of animations works atm?

PostPosted: Mon Dec 24, 2007 6:27 pm
by Paradox
Warning: untested and very speculative rambling ahead!

Seek points have interested me for the longest time. They make animations look nice and work properly. When Adam asked about them for his code, I started looking into them more closely.

(All information is for the standard "click" animation, such as journey cloths and doors)
You need a point object to be where the avatar will stand. This should be level with the ground.
The point object should be 2 blender units away from the clickable object (the point where the avatar's hand should touch).
The clickable object needs to be slightly more than 4 Blender units above the ground/seek point.

Now I just need to make some really fancy stuff happen... :P

Re: what kind of animations works atm?

PostPosted: Tue Dec 25, 2007 1:00 am
by Jennifer_P
You know, I always wondered how seek points worked (generally while I was waiting in annoyance for the avatar to finish shuffling around in 3rd person so that I could get back to my theoretically locked-in-first-person POV). It seemed like it would be pretty complicated to move the avatar to just the right place and orientation so that it could perform an animation, but thinking of it now I suppose it's not too complicated in theory.

Actually... With a bit of Python and an Activator in your age, you can make an avatar go through a standard Cyan animation.

So are activators all types of objects which initiate animations (i.e., benches or footpads), or just the specific 2 out, 4 up objects? Or do the standard Cyan animations not include footpad pressing and sitting...?

Re: what kind of animations works atm?

PostPosted: Tue Dec 25, 2007 1:50 am
by Trylon
Very interesting :)

Re: what kind of animations works atm?

PostPosted: Tue Dec 25, 2007 1:57 pm
by Tsar Hoikas
An activator is a specific type of object in a PRP file. See "ActivatorConditionalObject" objects in PRPExplorer for more info, PRPExplorer 0.6 has an editor for them. What they do it tell Uru that an object is clickable or sit silently waiting for your avatar to somehow manipulate it. Once you've triggered the activator by clicking, entering a region, etc. It sends a message to other objects that will begin doing some fun things...

Hopefully that explanation suffices.