Any way to bypass having to preload actor animations

The way the parenthesis and brackets are put down are extremely confusing and frustrates me.Is there any way to bypass it? I’m only looking to bypass actor animations

self.ralph = Actor(“models/ralph”,
{“run”: “models/ralph-run”,
“walk”: “models/ralph-walk”})

I really don’t understand this.

Toon = Actor({'Torso':'phase_3/models/char/tt_a_chr_dgm_skirt_torso_1000.bam', \
			 'Legs':'phase_3/models/char/tt_a_chr_dgs_shorts_legs_1000.bam'}, \
			 {'Torso':{'Idle': 'phase_3/models/char/tt_a_chr_dgm_shorts_torso_1000.bam', \
			 'TorsoAnim':'phase_3/models/char/tt_a_chr_dgm_skirt_torso_neutral.bam'}, \
			 'Legs':{'Idle':'phase_3/models/char/tt_a_chr_dgm_shorts_legs_1000.bam',
			 'LegsAnim':'phase_3/models/char/tt_a_chr_dgm_shorts_legs_neutral.bam'}})

especially this.

To start with, this doesn’t directly answer your question, but in case it helps:

To start with, both of those are perhaps not formatted in a very readable way. Furthermore, the second example doesn’t seem to be doing the simpler approach to animation, which may make it even more confusing.

Let me try to explain what’s going on, with the first example that you posted, but reformatted a little:

self.ralph = Actor(
                             “models/ralph”,
                            {
                                 “run”: “models/ralph-run”,
                                 “walk”: “models/ralph-walk”
                            }
                           )

What’s happening here is that we’re constructing an Actor, and passing into its constructor two parameters. The first is the location of the base model-file. The second is a dictionary, associating animation-names (that is, the names that you want to use in your code) with the locations of animation-files.

So, in that example, “models/ralph” is the location of the base model-file. the strings “run” and “walk” are the names that we’re giving to our animations. The strings “models/ralph-run” and “models/ralph-walk” are the locations of the animations that we’re calling “run” and “walk”, respectively.

That said, as to your actual question:
I think that you can load animations at a later point using the “loadAnims” method–see the API for more information!

1 Like