PDA

View Full Version : Crowd instancing question.



Mr Rid
11-06-2013, 11:16 PM
I need to have say a crowd of 100 CG people standing around, facing different directions, and they have some random motion like a typical, waiting crowd. Its easy enough to have one, or a few long animation(s), applied to maybe ten or so different models, randomly instanced, rotated, and with randomly offset animation, so it looks like a convincing crowd. But after several seconds, I need all of the figures to say stop and turn their heads to face camera at the same time. I am tired right now, but I cant concieve of how to do this in LW. Any thoughts? How would I apply random motion to dozens of figures, but then have them all suddenly moving in synch at the same moment?

vncnt
11-07-2013, 12:54 AM
If you can get away with a linear motion, create a Rotation Item for every head in Motion Options tab Controllers and Limits. Then animate the percentage of influence via a single MasterChannel.
Use a set of MasterChannels to add several different turning speeds.

If there is more time and/or if you need more individual details, you could register for RigManager_beta3 for a maximum of 10.000 character rigs in one scene. Beta3 is about to be released and is free (1 year) during development phase.

http://forums.newtek.com/showthread.php?136828-How-to-change-a-rig-in-45-scene-files&p=1352208#post1352208

RebelHill
11-07-2013, 02:38 AM
Yeah... tough.

Obviously you can get the timing of the turn at the dn to sync up, you just have your 10 anims all turn and look at the same time... problem is with the randomised instancing and particularly the rotation of those instance. Though all characters would all stop, turn and look at the same time, they wouldnt all look in the same direction.

I guess if you keep the feet out of shot somehow then you might be able to get away with rotating the instances also to time in with the animation, bringing them all back into line. Not perfect and could look dodgy, but other than that, I cant think of any way that saves you the laborious task of doing a lot of manual work on all 100.

pooby
11-07-2013, 02:44 AM
Could you have the heads separate and control them separately? I know it wouldn't look great up close, but you might get away with it from a distance.

RebelHill
11-07-2013, 03:14 AM
Yeah... I guess its either compromises or a fair deal of manual labour... I guess if it were me Id be tempted to attempt a code based approach (essentially writing a basic, task specific crowd simulation system), but that probably wouldnt save you anything time wise as compared to doing it all by hand.

erikals
11-07-2013, 05:32 AM
what camera angle is it?
and how close are the characters?

Mr Rid
11-07-2013, 11:26 AM
All the figures would be seen head to toe.

vncnt, all figures would have to turn their heads varying degrees. I've never used Relativity, but glancing at 'Motion Blender,' I dont think that will help, for the same reason.

I assume this falls in the area of Massive, or coding which I have no clue about. I wonder of Golaem is capable. But it seems like I just need to somehow envelope a 'head target' into overriding the head keyframes. I've needed 'dynamic targeting' before., or 'Dynamic- Use Bones/MDD of Other object.'

Pooby, yes the head-&-necks could be separately rigged. But there is no getting around the need for randomly offset animation up until the moment the heads turn. But on a particular frame, I could key all bones in place, remove all head keys after that point, then manually key each head to turn. Although I know it wont actually be that simple.

RebelHill
11-07-2013, 11:42 AM
There's no need to override the head keyframes... just create an offset item under the keyframed head control that gets its own separate animation, giving you additive animation on whats already there... or you could do an override by using a clone head control item, and using a blended SAI to take over at the appropriate point.

The problem with just focussing on the heads though is what happens to characters who are initially facing away from the camera, unless you can turn the body too on those specific characters, then you're gonna get exorcist heads.

I imagine a ready to go crowd sim like golaem might be capable, I guess it depends if it has hooks for doing "look at" control for crowds as well as the other stuff (given the use to do stadium crowds, Id guess, yes... but spose you'd have to find out proper one way or the other).

Otherwise... yep, the only options are to do the targeted heads, clean up any errant body orientations by hand... or code a specific tool. Such a tool wouldnt be that big a deal to build (obv for someone who knows how), but as I say... I doubt it'd be anything of a time saver over the (tedious) manual approach.

ianr
11-07-2013, 12:07 PM
This seems a coder gig in Massive,but If you get get time
why don't you contact the German gentleman 'Pille' who is writing
PAgent or Pagent Rev2.0 a large plug-in for lightwave.
He's been up on these forums.
http://forums.newtek.com/showthread.php?132900-
Multi-agent-system-for-Lightwave-Development-(Pagent-2-0)&highlight=pagent

P.S. You can call it Children of the Damned Rig.!

Netvudu
11-07-2013, 01:05 PM
What about having the first animation as an MDD, blended with a bone-driven head animation which points to a point (null or whatever). For starters, only the mdd is coming out from that blending (a mixer node will work) and changing that blending at one point with the motion of another null. That sounds like something pretty doable through the node editor.

erikals
11-07-2013, 01:15 PM
yeah, thought the same, not sure if it would work though, and how much time it would take to set up.

considering it's only 100 clones, it could be doable.

JoePoe
11-07-2013, 05:28 PM
So, I've sort of cobbled together a way to envelope targeting an object... in this case the camera.

I hope this type of thing can trickle down instances (which I don't have) so It only has to be done 10 times....

Okay, not my wheelhouse, but here's the thought....
For each person (to be instanced) include a null inside the head which is a child of the head bone.
Target that null to the camera. Animate the person as you will. The null will innocuously alway be facing the camera.
Use the Orient Constraint motion modifier. At the desired frame give the head bone a constraint that references the null at any specific H P B strengths you want. The head will snap to all the rotation parameters that the null has, which is (of course) pointing at the camera. Create a key (changes the "snap" to a nice curve). Done.

If it has to be done for all objects.... at least it (seems) to be able to turn heads varying degrees according to their relationship to the camera without have to figure all that out manually.

If this is way off, maybe it'll trigger another thought for somebody. :)

Of course it doesn't address the Exorcist scenario RH pointed out.
But it did work in my one object test.

erikals
11-07-2013, 05:35 PM
thought of that, but wouldn't it be kind of static if only the head moved?...
as usually when you turn, you would turn the body as well...

edit: yeah see you mentioned that... :]

RebelHill
11-07-2013, 06:04 PM
That is basically what I meant above when I said using a cloned head item to SAI blend to... It has to be a sibling item, it CANT be a child of the item constraining toward it as that creates a dependency error (parent follows child which turns with parent, which follows child which turns with parent, etc.) And whilst its a valid method for use on any number of actual boned characters, it cant be done with instances (as you cant instance bone animation like that), so its something you do on multiple clones... but ofc... exorcist.

erikals
11-07-2013, 06:12 PM
depending on the shot, background characters could be instanced (+head technique mentioned)
foreground characters could be animated normally, or using the #10 trick...

JoePoe
11-07-2013, 06:30 PM
....parent follows child which turns with parent, which follows child which turns with parent, etc......as you cant instance bone animation like that), so its something you do on multiple clones... but ofc... exorcist.

Ah, well, that's the part that was making me scratch my head. The Parent was referencing the child. But I seemed to get away with it. So the post.
So it can be done with clones but not instances. Okay.

bcicio
11-08-2013, 12:58 PM
Hi guys. I'm a novice and have no business being in this conversation because it is way over my head, but sometimes out of the mouth of babes... maybe use two identical sets of instanced crowds, the second set just being static and in the final position that the fidgeting crowd instances wind up in just before they turn their heads? Maybe Keep the static crowd invisible while the fidgeting crowd is moving and then instantly swap their visability so the fidgeting crowd disappears and is replaced by the static crowd? That way you separate the moving crowd and the turning heads into two completely separate things. It's then up to you to figure out how to turn everyone's head toward the camera because that's way beyond my knowledge. I'll now go back to what I was doing.

vncnt
11-09-2013, 11:16 PM
If you can get away with a linear motion, create a Rotation Item for every head in Motion Options tab Controllers and Limits. Then animate the percentage of influence via a single MasterChannel.
Use a set of MasterChannels to add several different turning speeds.

If there is more time and/or if you need more individual details, you could register for RigManager_beta3 for a maximum of 10.000 character rigs in one scene. Beta3 is about to be released and is free (1 year) during development phase.

Ok, beta3 of RigManager is released now.
See also: http://forums.newtek.com/showthread.php?136828-How-to-change-a-rig-in-45-scene-files&p=1352929&viewfull=1#post1352929

It works as simple as this:

Register for the full version of RigManager and install RigManager. Also install RigManager_assistant and MorphMixer_assistant for fast access to the first RigManager and/or MorphMixer in the nearest parent and assign keyboard shortcuts eg (Shift+Alt+R) and (Shift+Alt+M).
Create/open the rig of your human model. Add a Null between neck and head, create the Rotation Item in "Motion Options" tab "Controllers and Limits". Then animate the percentage of influence via a single MasterChannel. The head will follow the animation when the percentage of influence is set to zero, the head will gradually rotate in the direction of the Null. Add a Null with name="MASTER_Character_myNameHere", then parent the entire hierarchy of the model to this new Null. Save this file as "myRig.lws".
Start with an empty scene in Layout. Add a Null. Open Properties and press button "Add Custom Object" and select "RigManager" from the list. Save the LWS scene as "test_myRig.lws". After saving, double click on this plugin to open the Options panel. First, assign the "External Rig File". Second, assign the "Rig Hierarchy Parent" (this must be a Null, and the name should start with "MASTER_Character_"). Verify the "Rig Manager Folder". It should look like: "RigManager\test_myRig\MASTER_Character_XXXX\Instan ce#". Press the Ok button to close the Options panel. Press the Ok button to close the Options panel.
Now the fun part starts. Select the Null object that contains the RigManager plugin and press Ctrl+C for Clone. Number of Clones = 99 and press OK. Now you have 100 Null objects and all of them has a RigManager plugin attached. If you open one of them you can verify that each Instance# will have a unique number. Switch to the Top View and Move the Nulls into place (X,Z) for a nice distribution. [EDIT: make sure "Parent In Place" is turned off]
Save the scene and then use "Revert Scene to Last Saved" via a keyboard shortcut or simply re-open the same scene.
During re-loading: all 100 Null items will load their own rig from the external LWS (including their Sliders, MorphMixer, etc). All MasterChannels and Expressions have a prefix based on the Instance#.
In GraphEditor, double click on "MC" to open the envelopes of all MasterChannels and add keyframes to all of them at the same time in order to turn the heads in-sync. You still have the option to modify them individually.

erikals
05-16-2014, 07:39 PM
for heads turning, maybe...

morphed displacement headturns >
https://www.youtube.com/watch?v=mcdSEeewp_M
part move >
http://forums.newtek.com/showthread.php?107932-Part-Move-on-rotating-object
skelegons >
https://www.youtube.com/watch?v=XlY9NhgHDQ0