View Full Version : COFFEE & XPRESSO, Help needed DESPERATELY!
I am completely SPENT! i am sick in my stomach from battling for 2 days to get a simple TARGET Tag and some COFFEE Code to do what i want it to do.
Here is my dilemna... in two parts.
I have built a Camaro NEW GEN V8 engine (all the major internal components) for animation and simulations and i want to Rig/set it up for animation, so to do so...
First off i got a free COFFEE script which automatically positions the Piston to the cranks rotation (i only set the Con-rod lenght and the Journal offset to crank center), this works MUCH better than any IK rig and its so much faster to set up than Xpression with Trig, but when i assign a target expression to the CON-ROD so it always points to the piston the damn thing MIRRORS (or turns 180 degree BANK) itself and messes up the animation for every 180 degree that the crank turns.
Some of you may have done this type of animation before and are thinking, how the heck do you know the conrod spins 180 degrees or mirrors every TDC and BDC - well because the parts are built from the real engines parts they are not your average QUICK con-rods that have a basic shape and thats it. These particular con-rods have a flange or lip that has to point away from the journal and when it mirrors or rotates it is VERY obvious! and absolutely infuriating!
If somebody can PLEASE, PLEASE tell me how to get the Target tag from spinning or mirroring my con-rod every 180 degrees crank rotation, i'd be eternally grateful!
This one is not quite as straight forward, but i'll try to explain it as best i can.
The COFFEE code/formula which i downloaded to control the piston has one small issue - It was only intended for SINGLE piston engines, not multi-piston motors like the V8 i built. It WORKS absolutely perfectly until i start to rig the second piston, then this happens...
Piston one is set up to move accordingly to the crankshafts rotation, it knows where to opsition itself based on the LOCAL or Object Y axis of the crank. Sadly a V8 Crank has 3 more journals that are offset 90 degrees from the first journal - and here is the trouble...
the second piston that i set up acts as if its part of the first journal, when infact it is Piston #3 in the real engine on Journal #2. It is basically Lagging 90 degrees worth of crank rotation because it uses the Local Y axis of the crank.
I have already tried to move the piston to where it would normally be without the 90 degree lag but no go, when i rotate the crank it teleports back to 90 degree lag and makes me wanna cry.
Now i thought i would be real smart and use Null Objects that are parented by the crank and only rotate them to offset the Crank Y axis causeing the lag, i updated the COFFEE code to use the nulls but now it cant find them - it finds the CRANK when i enter the cranks name but not anything that is a child of the crank.
I am not completely lazy so i consorted the manual and read about a method for Xpresso in which you can target a Parent objects child by using a D as a constant - The D refers to Down the Hierarchy and will find bjects that are lower or children of Higher or Parent objects.
I just need to know how to update the CODE to find children objects in the hierarchy. If somebody can help me with this i would really really appreciate it.
If you need copy of the code just ask, or wait let me paste it in here...
var cr= 46.2;
var cl= 144.8;
var p= op->GetPosition();
var ofw= doc->FindObject("Crankshaft"); if (!ofw) return FALSE; <---
var rfw= ofw->GetRotation();
//get position of piston
<--- See that Crankshaft next to the find object, how do i modify that to find the NULL under that Crankshaft???
thanks alot for any help or suggestions.
10-14-2005, 07:38 PM
I assume you are pre 9.5-- in 9.5 there is an optional Upvector for the target---
You could try to attach a target expression in expresso, but i am not sure if the result is any different--- you could force/limit the rotation, though, via additional expresso i guess.
yip i'm a pre 9.5 user.
I'll try to limit the rotation on the target - even thought i dont know hoe to exactly do that, but i still need help on the most critical issue, getting the COFFEE code to use the Child Null of the Crankshaft parent :-(
10-14-2005, 08:39 PM
for getting child use GetDown(); and for next one GetNext();
10-14-2005, 08:46 PM
Head over to http://www.bobtronic.de/plugins/ and dload the free 2Target plugin,and all your problems are gone.
As for offsetting the rotation of all parts,
Place each system under a Null. Then don't use the actual modelled crankshaft in the coffe code.
Instead use a CircleSpline (With the radius coresponding to the code. Name each circlespline to something unique. C1 C2 etc.
Place a base object (whatever) as a child of each circle spline "along" the spline.
In each coffe tags code, replace the "Crankshaft" with "C1" and "C2" etc.
Use that base object as the base for the rods (rods being children of them)and use the piston as Targets in the 2Target plugin. Place a vector targetobject for each system and put it in the coresponding linkfield.
Rotate each system to the right offset.
Got to your modelled Camshaft set its rotation as "Set Driver" then select all CircleSplines and set them as "Set Driven"
All systems go!
10-14-2005, 09:06 PM
Like this. You need the 2Target plugin from the link above.
Thanks ALOT guys, really thank you all for replying so fast and for the clear instructions.
Okay, success report NR 1
Shriek of laughter :-)
The Con-rod NOLONGER mirrors or rotates - i tried the Expresso target system and it works the way its supposed to, unlike the dredded Target Tag :-)
I'll download a copy of that 2Target anyways, i have a feeling i'll need it later on - thanks for the link.
I'll go and try the code update, i have just one question Tcastudios.
Do the C1 C2 etc. object hafta be Circlesplines, or can i use Empty or Null objects.
See the code only uses the Crank Center point as reference and then Imagines the Journal offset and con-rod length, i dont Actually need precicely modelled geometry or objects that conform to the numbers as it asks only for a reference point to work from.
To double check what i said just now i quicly deleted my Crank and replaced it with a NULL object and it still works perfectly - thats the reason why i just wanted the code to seek the Null's under the crank instead of just the crank.
I'll report back any success/failures - thanks again everyone!
10-14-2005, 10:00 PM
Do the C1 C2 etc. object hafta be Circlesplines, or can i use Empty or Null objects.
As you found out, it could be anything. I just used it for placing the base object more easy.
okay i have some great news to report, ALL pistons, the crank and conrods + all bearings & bolts are now rigged and working 100% as expected, infact even better, i can rotate the engine in ANY direction and it just keeps going, upside down, banked 45 degrees whatever, just PERFECT - thanks A LOT! everyone.
Now comes the BIGGEST problem i have yet faced with this Engine of mine, The camshaft, valves, rockers and lifters.
I know exactly how to get the Lifters or tappets to push the Pushrods and then Rock the rockers and finally have the rockers operate the valves, what i dont know is how i should go about getting the Lifters/tappets to follow the surface of the CAM LOBES.
Please note that ALL components in this engine is POLYGONAL, if i am going to need to use Splines or Curves thats OK, i'll just trace the Cam Lobes with the Beziers.
This is the last hurdle in my wait to haveing a fully animated engine, so if ANYBODY can give me ANY advice on how to do the above, once again i am eternally greatful.
I'll go and Google some examples (if they exist) and come back later to see if anybody has decided to post something.
10-17-2005, 02:29 AM
Is this what you're after?
The User Data on the master null globally rotates all cams.
To create a new cam, Ctrl+drag in the OM. Rotate the Cam ** null until the pushrod is at the desired angle, then use the Lobe Offset User Data on the XPresso tag to adjust the lobe's default rotation relative to the pushrod.
The whole setup can be moved and rotated at the master null level without problems.
10-17-2005, 04:03 AM
Thanks darter, i'll check it out, i found a german site which shows how to do it, but MAN its complex, not only that but i dont understand german :-)
Yip its me DK3D with a different Screen Name (using my other PC - still automatically logs in with my OLD screen name)
10-17-2005, 04:22 AM
Okay i got it to work, sortof.
I downloaded the example file and i have one problem, when i rotate the Master null Everything rotates with it - pushrods included, but they do Trace the surface of the lobes, i just dont know how to get them to STAY in place and not rotate together with the lobes.
Maybie you use a different version of C4D, thats why mine has some small issues, i am using 9.1
Even with the small problem above i think i can still sort it out from here, if i get stuck or if i succeed i'll post again.
Thanks for goin through all the effort for me - that Expresso setup looks really complicated :-)
have a nice day!
10-17-2005, 04:35 AM
I'm using 9.1 too, so it should be working okay for you.
To rotate the cams together i.e. camshaft rotation, use the Camshaft Rot User Data on the master null. It should also be visible in the HUD.
To rotate an individual cam independently of everything else, use the Lobe Offset User Data on the XPresso tag for that cam.
To rotate a pushrod, rotate the null for its cam, then adjust the rotation of the cam relative to the pushrod using the Lobe Offset value.
To move or rotate the whole setup as a unit, use the master null.
10-17-2005, 10:47 AM
Okay, here's an updated and hopefully more intuitive version.
The lobe and pushrod each have an independent rotation offset control. Each is simply offset relative to the master null.
The camshaft, lobes and pushrods can be replaced as long as the hierarchy structure is maintained and the axes of the replacements are the same.
Thanks darter, i got the file to work the way i need it to, i just have one more question for you - is there ANY way to keep the Pusrod from intersecting the Lobe?
If you look closely you should see the sides edges of the Tip (pushrod) intersect the lobe as the pushrod moves along its surface, on the file you gave me thats not a Huge problem and its subtle enought not to notice at speed, but i am using Hydraulic Roller Tipped Lifters that have MUCH bigger contact surfaces, the Rollers CLEARLY (even at speed) sink into the lobes and i desperately neet to get this side effect from occuring - this model is being prepped for commercial sale so i must get it to look as Professionla and accurate as possible or people may not bother with it.
I have spent the last 2 days fine combing the manual but nothing works the way i need it to, for instance i decided to add a Collision expression to your xpresso model and tried to get the Pusrod from intersecting the lobe, but all the collider does is report whether a collision has occured or not, it does not actually keep objects from sliding into one another as i hoped it would - mean i want the objects to COLLIDE not jsut to get warned if it happens.
I am POSITIVE that C4D can do this effect the way i need it to but i just dont know how to do it, and resources for C4D on the net are so scarce (especially on engine animation) that i cant even get a good IDEA of what i am supposed to do, even so i have been battling on trying to get things to work but my skills are just too low.
The only place i can hope to find the specific help i need is here...
Oh and BTW, anybody that has given advice to me sofar will be MENTIONED by name and CREDITED for their advice and input once the model is released comercially - i dont expect anybody to just help me for the sake of it, so you will ALL be mentioned in the credits, if you would like to give contact info to go along your name and the thank you, please add it below and i'll include it.
THanks everyone for the great help so far, one more little hurdle and i can relax, FINALLY - i hope :-)
If some of you prefer a more, how shall i say, Cash motivation, i am willing to PAY for the Example file that acomplishes what i need it to do - and to be clear on it...
THe LIFTER must perfectly follow the surface of a Polygon or spline Lobe, it must not Intersect! If you have a method of doing so and would like to share or sell it to me, you guys know where to find me (in this thread BTW :-)
I think its pretty obvious that i am now getting desperate as i dont have very much time to get this done and just cant seem to get it right on my own.
Thanks again and
Have a nice day!
10-20-2005, 03:43 AM
What shape are the ends of the roller tipped lifters? Could you provide a photo or drawing?
ummm.... how do i describe them.
Ok i'm gonna link you to the site i have it on for sale - this is the PREVIOUS non animated version and it still looks plain and incomplete.
You should see a little thing that has a cylindrical shaped body with a little Roller at the end of it - there is an explided view of it showing the bearings and internal componets - you do know what a tappet/lifter looks like :-)
Thants it, just that little roller that has too stay on the surface of the lobe
here is the link BTW...
If you count from the last pic (crankshaft) 7 pics back you will be directly on it - 8 is what it looks like assembled.
10-20-2005, 08:01 AM
wow that looks amazing.
To avoid intersection use a proxy object for the collision,
a range mapper can then interpolate the neccessary movement.
10-20-2005, 10:12 AM
Here's an updated version with the roller following the surface of the lobe.
Ray Point 1 moves as the cam rotates, adjusting the hit position as the high point of the cam arrives. The movement is controlled by a Range Mapper node.
Three User Data settings on the Camshaft XPresso tag adjust the effect:
The Ray Point Range sets the range of movement of Ray Point 1 along the cam lobe axis.
The Angle Range determines the range in degrees over which the Ray Point 1 movement occurs.
The spline adjusts the strength of the effect over the Angle Range.
More tapered cam lobes should have a lower Angle Range and a higher Ray Point Range.
This works okay with my test scene. You should be able to adjust the settings so that it works correctly with your model.
Thank you VERY VERY much darter, wow that xpresso must have taken you some time - that stuff sure aint childs play :-)
The cam lobe your scene uses is very close to the shape mine uses so i think i am a mere few minutes tinkering away, really good job, dont be surprised is some people want to get hold of your xpresso skills after seeing my engine in action :-)
thank you one again and have a noce day.
hi Sneaker, thanks for the comment on my motor - thats 3 months of hard work to copy the real thing so i do appreciate any prositive remarks i get on it :-)
"To avoid intersection use a proxy object for the collision,
a range mapper can then interpolate the neccessary movement."
Any chance i could get that info in plain old english, ha ha - thing is i have never before used xpresso and i have a hard time understanding how all the things should link together - i get the logic behind it but i dont know how to PLUG everything in so it works properly.
With the scene Darter gave me i nolonger hafta worry about getting this part of the animation to work, but i sure would like to hear or even see your suggested method - i may need it for something else later on, and besides in the last few days i just realized how terribly important these Tools are - i regret neglecting to learn them on the excuse of "its just programmers that would care about that stuff" ha ha, it sure cam back to me.
I am just really thankful for this forum and everyone who has taken time out to help me, cause i look like a total noob - if ever i can return the favour - I WILL.
10-21-2005, 07:35 AM
Glad to have been able to help. I hope the expression works well with your model. Let me know if you have any problems.
Nice engine, by the way.
10-21-2005, 07:35 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2015, Jelsoft Enterprises Ltd.