Animation/LayerAnimation/Python Suggestions?

Help bring our custom Ages to life! Share tips and tricks, as well as code samples with other developers.

Animation/LayerAnimation/Python Suggestions?

Postby DanTheMystFan » Mon Mar 16, 2009 11:25 pm

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
User avatar
DanTheMystFan
 
Posts: 24
Joined: Sat Aug 09, 2008 9:42 am

Re: Animation/LayerAnimation/Python Suggestions?

Postby I.Brattin » Tue Mar 17, 2009 11:09 am

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
I.Brattin
 
Posts: 472
Joined: Sat Jan 31, 2009 3:06 pm

Re: Animation/LayerAnimation/Python Suggestions?

Postby DanTheMystFan » Tue Mar 17, 2009 1:06 pm

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.
User avatar
DanTheMystFan
 
Posts: 24
Joined: Sat Aug 09, 2008 9:42 am

Re: Animation/LayerAnimation/Python Suggestions?

Postby Jojon » Wed Mar 18, 2009 9:55 am

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.(?)
Jojon
 
Posts: 1116
Joined: Sun Sep 30, 2007 5:49 am

Re: Animation/LayerAnimation/Python Suggestions?

Postby DanTheMystFan » Wed Mar 18, 2009 12:37 pm

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.
User avatar
DanTheMystFan
 
Posts: 24
Joined: Sat Aug 09, 2008 9:42 am

Re: Animation/LayerAnimation/Python Suggestions?

Postby Jojon » Wed Mar 18, 2009 3:00 pm

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
Jojon
 
Posts: 1116
Joined: Sun Sep 30, 2007 5:49 am

Re: Animation/LayerAnimation/Python Suggestions?

Postby D'Lanor » Wed Mar 18, 2009 5:19 pm

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
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: Animation/LayerAnimation/Python Suggestions?

Postby DanTheMystFan » Thu Mar 19, 2009 10:12 am

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)
User avatar
DanTheMystFan
 
Posts: 24
Joined: Sat Aug 09, 2008 9:42 am

Re: Animation/LayerAnimation/Python Suggestions?

Postby D'Lanor » Thu Mar 19, 2009 10:47 am

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
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: Animation/LayerAnimation/Python Suggestions?

Postby DanTheMystFan » Thu Mar 19, 2009 11:35 am

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.
User avatar
DanTheMystFan
 
Posts: 24
Joined: Sat Aug 09, 2008 9:42 am

Next

Return to Scripting

Who is online

Users browsing this forum: No registered users and 6 guests