Fri, Nov 22, 8:34 PM CST

Renderosity Forums / Poser - OFFICIAL



Welcome to the Poser - OFFICIAL Forum

Forum Coordinators: RedPhantom

Poser - OFFICIAL F.A.Q (Last Updated: 2024 Nov 21 6:06 am)



Subject: Jiggles


ockham ( ) posted Thu, 19 February 2004 at 3:18 PM · edited Wed, 20 November 2024 at 4:55 PM

Attached Link: http://ockhamsbungalow.com/Python/jiggles.zip

file_99199.jpg

I thought about calling this Physics.py but decided to be honest..... In the Poser world, soft-body dynamics is just a fancy way of saying "Let's see those headlights jiggle!" As usual this is a preliminary version; I know there are some dubious points, but might as well collect your dubiousness along with my own before fixing. ------------------------------------------ Here's the readme: 1. Set up your animation first. 2. Select the part that holds the MTs (such as Hip,Chest, Left Collar) before activating. 3. Activate the script. 4. (Image 1 here) Hit Analyze and let the animation run while the script gathers motion data. This will take some time, but you only need to do it once per "session". The analysis records all three directions for the selected part. 5. When done, the list of MTs will be filled. (Image 2 here) 6. Pick a MT. (Or highlight all of a set that will share the same motion and calibration, such as a left-right pair.) 7. Pick the direction that this MT needs to move: Up-down, Front-back, or Side-side. 8. The appropriate acceleration will be applied to that morph dial, just about instantly. ------------------------ Look at the resulting animation. If the movement is too large or small, or goes the wrong way, keep the script active; don't hit Analyze again. Put a number in the Multiplier blank to change the size or direction, then hit the same direction button again. For instance, if the movement should be twice as large as the first try, enter 2.0 in Multiplier. If the motion is about the right size but backwards, enter -1.0 in Multiplier. The default action for a morph to be used with Up-Down is Downward = positive. So if you have a MT named "Breast Droop", it should work as is. If you have a MT named "Breasts Up", you'll probably need to make the Multiplier negative. The default action for a morph to be used with Side-Side is Leftward = positive. So if you have a MT named "Left Hair Out", it should work as is. On Side-Side, Jiggles does a special trick to make things easier. If you have highlighted exactly two morphs, and their names begin with L and R, the script will assume that the L item moves as described above, and the R item moves oppositely. If the morphs are "typical", this will usually be correct; but if the result is backwards, you can then enter a negative Multiplier to invert the pair together. If you want to take advantage of this trick with a pair that doesn't begin with L and R (say OutLeft and OutRight) you'll have to temporarily rename them to put the L and R in the first letter.

My python page
My ShareCG freebies


Dale B ( ) posted Thu, 19 February 2004 at 3:24 PM

Neato! Wonder how this will work with some of the Santa Monica dance bvh files....?


ockham ( ) posted Thu, 19 February 2004 at 3:32 PM

Well, give it some exercise! The sooner you break it, the sooner I can fix what's broken. ----------- A few more comments while I'm thinking of it. 1. This is simply a linear acceleration sensor; it doesn't try to pick up angular acceleration. There may be a way to do that, but I'm still foggy on that. 2. You don't have to rely on pre-made morphs, of courphs; you can always make your own MTs for this purpose by using magnets or whatever. 3. It works only when the figure is in a generally upright position. If you need to have the figure horizontal, you should set up the MT patterns in vertical position then turn the entire Body horizontal.

My python page
My ShareCG freebies


ockham ( ) posted Thu, 19 February 2004 at 3:48 PM

file_99200.jpg

I set up a simple motion, then selected Misaki's Hair, and hit Analyze. I then highlighted the pair shown, and hit the Side-Side button.

My python page
My ShareCG freebies


ockham ( ) posted Thu, 19 February 2004 at 3:49 PM

file_99201.jpg

And here's the result.

My python page
My ShareCG freebies


Barbarellany ( ) posted Thu, 19 February 2004 at 5:59 PM

Very cool, but the zip won'r open.


numanoid ( ) posted Thu, 19 February 2004 at 7:36 PM

Ha ha, I knew you could do it. That job at NASA is one step closer. I got the zip open. I have got the entire weekend to myself, the girlfriend is going to visit her Mommie, so I will definitely try to find a way to break this. I have been looking for something like this for months, and got so tired of faking it by hand. Thanks Ockham, you rule.


nomuse ( ) posted Thu, 19 February 2004 at 11:24 PM

Question is, can you do a damping oscillation (in re Haruhiko Mikimoto and Hideaki Anno's work on "Gunbuster")? :>


numanoid ( ) posted Thu, 19 February 2004 at 11:48 PM

Gunbuster? What is that and where can I see it?


nomuse ( ) posted Fri, 20 February 2004 at 4:14 AM

http://www.atpictures.com/display.php?g=gunbuster&img=gunbuster36.jpg From episode one of the OAV, demonstrating that you CAN flounce in a t-shirt and shorts. ^_^;;


ockham ( ) posted Fri, 20 February 2004 at 11:56 AM

Damped oscillation is a great idea. I'll add it to the script. Also thinking about how to add gravity effects. The math is simple, but fitting it into the control panel "naturally" is hard.

My python page
My ShareCG freebies


lynnJonathan ( ) posted Fri, 20 February 2004 at 12:04 PM

Attached Link: Video Clip

I did this real quick last night. It works great in Poser 5 but I couldn't get it to work in ProPack. Very usefull script!!! I've been wanting something like this for a long time. Please let me know if you update it! - The video clip is a DivX avi and its about 1 meg. I could probly get WAY better results if I spent more time. I was just seeing how it works.


ockham ( ) posted Fri, 20 February 2004 at 12:31 PM

Looking at your clip: Very nice bit of action! The acceleration detector picks up small changes, maybe a bit too much in some cases. A damping control will help on that. Also, I should have credited you as the producer of Misaki in my example image above. Misaki has become my all-purpose model. Unlike Posette, the mesh is rich enough to shape without jaggies. But the overall poly count is much lower than Koshini or Vicky, so that Poser doesn't bog down during adjustments and animations. And, of course, she's cute.

My python page
My ShareCG freebies


ockham ( ) posted Fri, 20 February 2004 at 12:40 PM

On working only in P5: not sure what's going on. I always develop scripts in 4PP and test them in 5, so they're more "at home" in 4PP. Could it be that you don't have the latest service release for 4? When you hit Help:About Poser, the version number should show 4.2.1.179 for the latest.

My python page
My ShareCG freebies


lynnJonathan ( ) posted Fri, 20 February 2004 at 1:25 PM

Actually, you're right. Mine shows 4.2.0.160 I thought I had updated with sevice pack 3. I go and download the update again.


lynnJonathan ( ) posted Fri, 20 February 2004 at 1:53 PM

OK. I feel like a real dummy. I cant believe all this time I was useing SR2! The script works fine too. - Thanks


ulysses ( ) posted Fri, 20 February 2004 at 7:44 PM

I've never run a Python script before so I'm trying to run the Jiggle script on my Mac using Poser 5.0.3.310 and OS 10.3.2, I used the default Judy Nude Hair figure and when I have her Left Collar selected and I run the script I get the following message: Traceback (most recent call last): File "", line 10, in ? File "Macintosh HD:Applications:Poser 5:Runtime:Python:Lib:lib-tk:Tkinter.py", line 35, in ? import _tkinter # If this fails your Python may not be configured for Tk ImportError: No module named _tkinter Any suggestions as to what's going wrong? Ulysses


ockham ( ) posted Fri, 20 February 2004 at 10:27 PM

On OS9 you have to change something in the registry to make Python work properly with Poser. Look for "Python Hack" in freestuff to find a reference to this. But on OSX it's all bad news. I'm pretty sure that the new Poser 5 for OSX will not run any of the Python scripts that use the TKinter front end. I believe the simpler scripts (the kind where you just activate the script and it does one thing without any user interaction) will still work. As I understand it, OSX uses a whole different breed of Python that has no Tk connection. Maybe a Mac expert can jump in here and either verify or counter this.... I'm just giving second-hand info.

My python page
My ShareCG freebies


Barbarellany ( ) posted Sat, 21 February 2004 at 2:26 AM

I'm on Mac OS 9.2 P4PP with SR3 and I get this error message: Traceback (innermost last): File "", line 23, in ? AttributeError: 'None' object has no attribute 'Name' I also added the Python Hack you suggested. Any ideas?


ockham ( ) posted Sat, 21 February 2004 at 10:00 AM

file_99202.jpg

Barbarellany: If you were on a PC, I'd say that you need to get the latest SR, as with LynnJ's problem. That "attribute error" coming early in the script is typical of the earlier SR. On Mac, I just don't know! In case the error comes from some odd Python parsing problem on the Mac system, I made one little change in that line. The altered script is posted right here as Attached File. Take the text and rename it to Jiggles2.py or something like that. I don't really think this is the problem, but you never know......

My python page
My ShareCG freebies


ockham ( ) posted Sat, 21 February 2004 at 3:56 PM

Barbarellany: I just got this same error AttributeError: 'None' object has no attribute 'Name' when trying to use the script. The problem was that the selected Actor wasn't on the selected Figure; to be exact, the figure was Misaki and the Main Camera was the selected Actor. I thought I had provided for this situation with a meaningful error message, but obviously not. The script wants to have the Actor (like Chest or Head) part of the selected Figure.

My python page
My ShareCG freebies


Barbarellany ( ) posted Sun, 22 February 2004 at 6:28 PM

D'oh! Thank you. I am still trying to figure the whole thing out. Does it make a new dial or add to the existing dials? Sorry to seem dense. I'm trying to work out alot of other things at the same time for a test annimatiion, so I probably haven't given it enough time yet.


ockham ( ) posted Sun, 22 February 2004 at 10:34 PM

Good basic question. No, it doesn't make a new dial. Your figure has to have some suitable morphs already; some deformations that can "swing" in the direction you want to move. What the script does is to analyze the figure's overall motion... running, jumping, sliding, whatever.... and calculate the accelerations. Whenever the figure speeds up, slows down, or changes direction, anything that can flop will flop in the same direction as the acceleration. Try it on yourself. If you have fairly long hair, move forward, backward, and sideways, and note when the hair swings. Or if no hair, do the same thing with loose clothing like a shirt tail. The swinging object is sensing accelerations: any starts, stops, or changes in speed or direction. So, if your Poser figure has something that can "swing" by means of a morph target dial, the Jiggles script will make the swing happen at the right times. Incidentally, my little hair demo animation above is backwards; I tried the swing experiment on myself only after posting the animation, and realized that I should have negated the multiplier!

My python page
My ShareCG freebies


numanoid ( ) posted Sun, 22 February 2004 at 10:48 PM

file_99203.jpg

OK, been testing.

I don't know if I made a mistake, but when I finished this is what I got. The P4 Fem with a 30 frame run cycle and a ponytail. I got the ponytail to bob in time to the run without any problems, but when I opened the keyframe window, I saw that the script only worked out the movements for 28 frames. I don't know if it is supposed to do that.
It worked beautifully though and looks very realistic. No more hair that looks like its made of steel.

The only other problem I had has nothing to do with this script, but more to do with the lack of decent collision detection, because the ponytail obviously penetrates the womans back on the downswing while she runs, so maybe the hair is made of steel after all.

I also used the TripleGraph script to fix the motions and that works beautifully too. No problems with that.

The only problem I can see with the Jiggles script is having an object with too many morphs, and having to scroll endlessly to find the morphs you actually want to affect with the script, but that is also not a shortcoming in the script.

Thanks Ockham. It works great and combined with the Naturalizer I got her to breathe (pant) realistically while she runs as well.

What's the next thing you got up your sleeve?


ockham ( ) posted Sun, 22 February 2004 at 11:08 PM

Yes, 28 out of 30 is exactly what it does. I calculate the acceleration by using "finite difference math", which is a cheapo way of doing a derivative. Sort of like this in pseudocode... for n=1 to 29: Velocity[n] = Position[n+1] - Position[n] for n=1 to 28: Acceleration[n] = Velocity[n+1] - Velocity[n] So the last Acc value is at 28. I've noticed that the whole business works best if the animation has some extra frames after the motion stops, to give Poser's spline a chance to fall back to zero after the "swing". Maybe 1/2 second of margin is good. I'll put this in the readme after it's all cleaned up a bit. I'm adding gravity and damped oscillation.

My python page
My ShareCG freebies


numanoid ( ) posted Sun, 22 February 2004 at 11:15 PM

Has anyone told you that you are sounding very clever? I will wait for the gravity and dampeded oscillation before I carry on testing. All I want to know, is will you also be adding an internal vascular system so that the model bleeds realistically when wounded, complete with fluid dynamics. Lol. (PS. This is a joke, not a request)


ockham ( ) posted Mon, 23 February 2004 at 12:49 AM

file_99204.jpg

Actually I cheated. The only Python involved here was Naturalizer; the rest is just scaling and moving balls.

My python page
My ShareCG freebies


numanoid ( ) posted Mon, 23 February 2004 at 1:59 AM

Lol, I am dying to get Metaforms, because I need a scene in my movie where the character is wounded, and bleeding, but I hear that it won't export to Vue, so I am going to have to cheat as well. I have a morphing puddle, and with the right texture I should get a real bloody and gory looking effect.


Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.