Gears [Script v. 0.0.2 halfway Pg. 4]!

Hi Stefano,

Great to see you’ve done such a good job in your resurrection of this old code. I can’t wait to play with it again sometime soon. :smiley:

Jonathan Merritt.

I’ve created a spur gear and a pinion. When I spindup the spur gear (default 20 teeth), all seems just fine. When I try to spindup the pinion (default 12 teeth), it doesn’t spin around it’s center, but what appears to be around the spur gear’s center. I’m sure I’m just doing something wrong. Any ideas what it could be?

Thanks in advance.

Make sure you snap the cursor to the pinon gears center before doing spin dup.
Paradox

I swear I thought of that. But before I posted, I thought I’d better go back and double check it again … and it worked … I must be going nuts. Thanks :slight_smile:

You welcome, it’s always the simple things we thought we did that we tend to overlook. Happens to all of us I suspect.
Paradox

It certainly happens to me :slight_smile:

Ok, I’ve got my spur gear (Gear A - 20 tooth) and my pinion gear (Gear B - 12 tooth). I ran the animation script, added two entries, entered the gear names and the teeth. Pressed Link and set the driver to Gear A and the driven to Gear B, the type to Mesh, and pressed Generate. I can only assume that the DriverSL script was created (how would I know?).

I then set up a script link to DriverSL at FrameChanged. I created a ROT key at frame 1, then (as per the included PDF docs) pressed ALT A … and as I suppose you could guess, nothing happened. The docs are greatly appreciated, but not to clear to a newbie as myself.

When this didn’t work, I tried to manually create a RotZ IPO curve in the IPO window, although with only 1 vertice. The docs simply said “Select the driver and add a RotZ IPO to it”

Any ideas (I must seem so stupid to you)? :expressionless:

Edit

Just so you know, I did create an empty at the center of the Driver Gear, Gear A, as a parent to both gears. The Z axis of the empty is the same as the Rotation axis of both gears. I moved the empty to test the parent/child relationship and to position it better for the camera. Other than moving the empty, neither gear was moved since they were created.

you have to create an empty for EACH gear ( one for driver, another one for driven) parent each gear mesh to its own empty(note empties should be at the center of their child gear). name your empties and use their names for the driver and driven settings

when you’ve done the scene link with the DriverSL (think your right to assume its done, i dont know how to check either)
then manually create you z rot ipo for the empty of your driver

alt a and the driven should turn

Ok, thanks … I’ll try that. Is it ok to create a third empty that is the parent to the two gear empties? This way I could move the entire assembly at one time.

Edit

I tried what you said. I created two empties centered on each gear, and parented to the child gears. The driver name was A Parent, the driven was B Parent. When I pressed ALT A, the following error was in the console:

File “DriverSL”, line 11
A Parent = Object.Get(‘A Parent’)
^
SyntaxError: invalid syntax

I will try it again, changing the name to get rid of the space. It’s just a thought, but many programming languages don’t like things like that :wink:

Edit

I tried changing the name. Here are the step-by-step reports from the console:

After adding AParent empty to script:

200
OK
1
Che ci faccio qui?

After adding BParent empty to script, and changing teeth to 12:

200
OK
1
Che ci faccio qui?
1
Che ci faccio qui?

After setting up the links:

101
LINKS_EV
300
OK
1
Che ci faccio qui?
1
Che ci faccio qui?

After pressing Generate:

4
OK

The IPO was already created (again, with only 1 vert), so I pressed ALT A. Nothing happened and there was no report in the console.

:-?

Here is a screenshot to give you an idea how the gears are set up:

http://www.dealexpert.net/upload3/image.php?name=screenshot.jpg?

My gears are ready … just waiting for a knowledgeable somebody to help me (see my last post) … by the way, sorry for double posting.

DYeater:

Your earlier post sounds like you followed the right steps (Using the Gear object names, not the Empty names).

All you should have to do after the steps you’ve already completed is enter a valid RotZ IPO curve for the drive gear:

For example:
frame 1, 0 degrees
frame 250, 360 degrees

exit edit mode on the curve, preess ‘T’ and choose ‘Linear’
then from the curve menu, select ‘Extend Mode’ : Extrapolation

Now you should see your gears rotating when you run the animation.
If not, then I don’t know what the problem is.

I am experiencing a problem that when I run the animation, the pinion gear will rotate initially, such that it is meshing directly with the main drive gear’s teeth. Is this happening to anyone else?
I thought it was working when I tried it earlier (a day or two ago), but now I’ve tried it a few times and it keeps happening - I tried adding the script link after adding the RotZ IPO curve, etc. I can rotate the vertices of the pinion slightly in Edit mode to correct the problem. Any ideas?

S68:

Excellent script.
I went through your pdf document and edited it a bit - mostly typos.

If you’re interested:

http://www.telusplanet.net/public/kugyelka/blender/bmg_pdf.html

Thanks

Great, thanks, I’ll give that a try. Is there any reason then to add empties to each gear? I know that at least one empty has to be added so that gear assemblies can be moved without affecting gear placement. Can it be the parent of both (or more) gears?

Edit

I Have Animation !!!

Just one problem, and it may be the same problem as Gimble is having (not sure I understand his problem, but it sounds similar to mine). When the gears move, they do indeed move in opposite directions, but the teeth are no longer meshed. Instead the cogs overlap each other, and don’t mesh.

I verified that both gears have the same number of teeth as I input in the script (spur=20; pinion=12).

But at least I have some motion now :slight_smile:

Edit

Well … I had motion, but not any more. Now the driver gear rotates, but the pinion does not. I tried re-entering the data into the script (adding gears and linking them) and pressing Generate, but no good. The pinion won’t animate now. :frowning:

I just love this script and it’s capabilities … can’t wait until the bugs are worked out.

Edit

Ok, this is really weird. I reloaded a blend where the animation worked, and ran animation after animation with no problem. Then I decided to apply a material to the gears by appending a material (brass) from a materials library. As soon as I did the pinion quit rotating.

I reloaded the blend that worked, added a cube (separate from the gears), ran the animation, no problem. I added a material to the cube by appending the brass material again and the pinion stopped rotating. I reloaded the working animation, and appended a simple cube to the scene from another blend (no material) and the pinion stopped rotating. I did this several times. It seems that any attempt to append anything stops the animation from working correctly. I have yet to try appending something before running the animation script … I’ll let you know.

Hi!

I was not much online lately, sorry…

Dyater

THe script DriverSL is generated, and you can check/edit it in the text window!

THe docs sadly assume that the reader has enougth confidence with blender, I cannot explain all… there’s the manual for IPO and Spindupping :wink:

And a IPO with one vertex only is not enought!

Furthermore the empties are necessary only if you plan to move your gears, If they will stay flat on the z=constant plane then no empty are needed.

For the A PArent problem… I assume you cannot use spaces in names or pyton will crash!

Gimble

THanx for proofreading, I’ll browse it ASAP

THe ‘initial’ rotation must be solved by you.

THe script does not ‘add’ but rather ‘set’ rotation of pinion with respect to gear, so the original ‘unrotated’ pinion must mesh correctly

You can achieve this, after clearing rotation (or just after a frame change back to 1) by rotating the pinion in EDITMODE or by rotating the Empty it is parented to.

Stefano

Well, I’m sorry I’m such a newbie. I like the script, but I have some problems working with it. If there is anybody who would like to work with me to solve them, I’m sure it will benefit all who plan on using this script.

Other than the append problem indicated in one of my previous posts, I am now having problems with the pinion gear of a conical gear setup. I parent an empty to the center of the pinion, rotate and move the empty to position the gear, but no matter what axis I set the empty at, the pinion rotates around the global Z axis. I’m sure this has something to do with the local axis of the empty, but I’ve not yet needed to deal much with local axises (axiss’ … axiseses … :-? )

Well, any help would be greatly appreciated.

Your earlier post sounds like you followed the right steps (Using the Gear object names, not the Empty names).

:expressionless: sorry.
though i used empties and their names and it worked, makes it easier if you decide to move the gears(which you will if its anything but a test)

I parent an empty to the center of the pinion, rotate and move the empty to position the gear, but no matter what axis I set the empty at, the pinion rotates around the global Z axis. I’m sure this has something to do with the local axis of the empty, but I’ve not yet needed to deal much with local axises (axiss’ … axiseses … )

i had this problem, i might be wrong but i did this:

assuming the empty thats the parent of the pinion is the driver,(as in my case), it has a zrot ipo. (yes?) if you parent that empty to a new empty then rotate the new one, the orignal empty rotates arond its local axis and you can use the new one to fine tune positioning

Well, my drive gear is the spur, but that is easy enough to change. I’ll give that a try. Thank you so much. I hate to be a pain like this, but I really want to get this to work :slight_smile:

Have you tried appending anything from another blend to the blend with the gears? One of my past posts describes the weird behavior I encountered when trying to append a material.

Edit

It worked! malf, you are a real goldmine when it comes to this script. I never would have thought of the solution you came up with. Thanks :slight_smile:

Now the append problem (if it’s not something stupid I’m doing again) is a real pain. In short, if you try to append a material (even just an object) from another blend file the animation of the driven gear stops working. I just verified this again with the working conical gears.

This is just a guess, but I’m thinking that the append process is using a python script and this is overwriting the DriverSL script. I say this because the driven gear is controlled by the DriverSL script while the Driver Gear is controlled by the animation IPO.

If this is the problem, it might be limited to the append process. I added a couple of cubes to the blend and ran the megabool script and it had no effect on the gear animation.

i just want to say thankyou for creating such a wonderful script. I have played around with it and followed the instructions (typos and all - we all do that sometimes!) and although it took me a sec to get the right links and all it came out nice! i haven’t really any bugs to report and there isn’t much i can come up with to make it any better! The only thing that i would like to see is some preset gear centers although with the modeling them is easy… Good job and thanks!

: wishes he had your skill

Prince

Thanx guys

DY No need for excuses, we were all newbies at a time :slight_smile:

You are rioght on APpend. THe Scriptlink is lost, but the DriverSL script is still there, it is just the link to the scene that is lost. I’ll file in a bug report

For the empties, I still have the duobt that you are parenting the other way around. THe Gear must be Child of the Empty, not vice versa, I really can’t get from your post if you are doing this correctly (Select Gear, then select empty, empty is light purple, press CTRL-P) Parenting must iccurr before any rotation

prince If you say there are no bugs it’s because you haven’t tried conical gears with an axis angle different from 90° :stuck_out_tongue:

I’ll fix that today

Stefano

S68. Looking at some of the animations you’ve created with this script, I wanted to try it. It’s very impressive. :slight_smile:

This is the first python script I’ve used, and using the pdf as a guide, I managed to generate a spur gear and pinion (just used the default settings). Then I ran the spinning script (which I had to open in the text window because it won’t show up on the menu in the scripts window).

As instructed, I added the two gears by putting in the gear names and amount of teeth. Then, when the pdf read: “Now press the Links toggle”, I realised that the top part of the interface wasn’t there.

Any initial ideas as to why this might be happening?

Oh, and: Thanks for the script! :smiley:

Well,

if you copied both scripts in your .blender/watever directory they should appear both, the ‘spiner’ is in ‘Anim’ menu, not mesh :slight_smile: But this is something new and I’m not confident yet, I might have made some mistke.

For top part of interface… both script have a top part :slight_smile: is it lacking only in the second script?

I’d guess that you have a low (1024x768 ?) resolution, and a small script window, so the top part of the interface falls ‘out’ of the window…

you can try to make the script window bigger!

Good luck

Stefano