Animation/LayerAnimation/Python Suggestions?

Help bring our custom Ages to life! Share tips and tricks, as well as code samples with other developers.
User avatar
DanTheMystFan
Posts: 24
Joined: Sat Aug 09, 2008 9:42 am

Animation/LayerAnimation/Python Suggestions?

Post by DanTheMystFan »

For the last few days, I've been trying to figure something out.

My idea is to have several lights (hopefully 16), set around a room, each of whose color can be controlled by a panel of some sort. In addition to setting a solid color, the user would be able to set the colors to cycle smoothly. In addition to the light itself, I have a light flare and light filter that I would like to animate as well, corresponding to the color of the light. I currently have a Layer Animation set to the R,G,B Material IPO curves in Blender.

I've been researching this Plasma stuff and have thought of several ways to accomplish this. I could use SDLs and Python to set the color of the lights at least--I'm not sure if I can set material colors or mess with layer animations directly from Python. I could make the cycling an animation and use Python to jump to a certain frame, but from looking at PyPrp, it doesn't look like you can pass animations or material animations into a Python file. I'd like to have 16 of these lights, so I don't want to do anything that would put too much strain on the client or server, and I'd like to have it multiplayer compatible as well. Does anyone have any ideas?

Thanks,
Dan
I.Brattin
Posts: 472
Joined: Sat Jan 31, 2009 3:06 pm
MOULa KI#: 0

Re: Animation/LayerAnimation/Python Suggestions?

Post by I.Brattin »

Well we know that it is possible to have multiple lights with different colors. Bevin and Kirel have lights you can turn on and off that and each switch is for a different color.

My question is not is it possible but can Blender do it.
MOUL Again Ki #'s
I.Brattin - 777796
Jayden Halliwell (IC Explorer) - 54404
User avatar
DanTheMystFan
Posts: 24
Joined: Sat Aug 09, 2008 9:42 am

Re: Animation/LayerAnimation/Python Suggestions?

Post by DanTheMystFan »

The Bevin and Kirel lights are just 3 sets of colored lights that each turn on and off, though. I'd need several different states and animations for both a light and a material, and I'm not sure how to go about this.
Jojon
Posts: 1116
Joined: Sun Sep 30, 2007 5:49 am

Re: Animation/LayerAnimation/Python Suggestions?

Post by Jojon »

You should know that DirectX has (or used to have, at least) a limitation on the number of light sources (eight) that can affect an object at a time. More lights can in some situations be faked, using projection lights.

I sounds like you intend to give the player ways to set actual RGB (or equally specific) values for each lamp, rather than a few presets.(?)
User avatar
DanTheMystFan
Posts: 24
Joined: Sat Aug 09, 2008 9:42 am

Re: Animation/LayerAnimation/Python Suggestions?

Post by DanTheMystFan »

I heard about that limitation about lights. They're spotlights in a large room, so they only affect a few objects each. As far as RGB, I was planning on doing that, but it looks like it's impossible to set material colors directly. I'm trying for 12 presets as of now, which is an awful lot of Alcscript (and Responders), so I'm thinking of using Python to set the color cycle animation to a variable time and then stop it, keeping the lights, etc, on one color.
Jojon
Posts: 1116
Joined: Sun Sep 30, 2007 5:49 am

Re: Animation/LayerAnimation/Python Suggestions?

Post by Jojon »

Well, you and I know of no way of modifying the material colour from the Plasma Python interface, at least -- maybe somebody else could wisen us up. :)

In the meantime, I notice the following interesting animation message commands:

- playtotime
- playtopercentage
- gototime
- incrementforward
- incrementbackward

:)


EDIT: Unless you bite the bullet and create anmations to and fro each and every preset, after all. :9
D'Lanor
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: Animation/LayerAnimation/Python Suggestions?

Post by D'Lanor »

To complete that list:

- continue
- stop
- setlooping
- unsetlooping
- setbegin
- setend
- setloopend
- setloopbegin
- setspeed
- gototime
- setbackwards
- setforewards
- togglestate
- addcallbacks
- removecallbacks
- gotobegin
- gotoend
- gotoloopbegin
- gotoloopend
- incrementforward
- incrementbackward
- runforward
- runbackward
- playtotime
- playtopercentage
- fastforward
- gotopercent
- numcmds

I have used gotoend which works well.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
DanTheMystFan
Posts: 24
Joined: Sat Aug 09, 2008 9:42 am

Re: Animation/LayerAnimation/Python Suggestions?

Post by DanTheMystFan »

The problem is if I use animcmdmsgs, I'll need to have a different one for every color and light :(
What I think I'm going to do is use a PythonFileMod and pass in the desired color and animations from a GUI, and netforce the animations. This way, I won't need 16 x 12 responders. And if I want to make a slider later, I guess I can do that.

Another question though: Can I netforce all 16 animations? I'm not sure how else to synchronize them over the network (unless I actually repeatedly write the frame number to an SDL, then get it back)
D'Lanor
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: Animation/LayerAnimation/Python Suggestions?

Post by D'Lanor »

I am glad to see that you are concerned about multiplayer aspects. You really need SDL states though if you want to sync players who link into the age after the event.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
DanTheMystFan
Posts: 24
Joined: Sat Aug 09, 2008 9:42 am

Re: Animation/LayerAnimation/Python Suggestions?

Post by DanTheMystFan »

So I do need to use SDL states then? I was assuming if I set netForce to 1 that the animations would automatically work. The thing is, I'd like to have a color cycling animation, and it could potentially be on any frame when a player links in. I'm assuming setting an SDL state on every frame change is out of the question for 16 lights. And in addition, is there a way to reference the light and layer animations when an SDL state changes? The only way animations seem to be referenced is to pass them in to a PythonFileMod.
Post Reply

Return to “Scripting”