Jump to content

Peter Menich

Registered Member
  • Posts

    5
  • Joined

  • Last visited

Peter Menich's Achievements

Newbie

Newbie (1/14)

  • Reacting Well Rare
  • Week One Done
  • One Month Later
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

1

Reputation

  1. does it work on 2024? Need to know before I pull the trigger P
  2. hey. Thanks for taking the time to respond, but you've actually done the complete opposite of what I wanted! I wanted sharp corners, not curved. :o( P
  3. Hey, I'm trying to model a complex boat hull by lofting splines & getting stuck on a few issues. Firstly, how can I get the corners to be accurate? Whenever I use loft I don't seem to have any control over sharp edges/corners. Just upping the subdivision U value is a total crap shoot. It's like I need to be able to weight the corners so they're sharp like when doing a surface subdivision. - is there no other way???!!! Like, what happened to Coonsmesh? Does Splinepatch still work in 2024? Are there any other modelling plugins that let you loft / patch splines more accurately? This seems to be a bit of cinema blind spot / missing tool. Pete loftMe.c4d
  4. Managed to finally figure this out. For future peeps looking for this I've attached the project. There's still a slight bump in the curve at the first keyframe, will try and get to the bottom of that - unless someone wants to chip in! P Smooth_Rotater_V2.c4d
  5. Hey, I've been trying to create a python node in xpresso to emulate this bit of code from the amazing Mr Ebberts... http://motionscript.com/articles/speed-control.html Here's the After Effects expression I'm trying to translate... spd = effect("Slider Control")("Slider"); n = spd.numKeys; if (n > 0 && spd.key(1).time < time){ accum = spd.key(1).value*(spd.key(1).time - inPoint); for (i = 2; i <= n; i++){ if (spd.key(i).time > time) break; k1 = spd.key(i-1); k2 = spd.key(i); accum += (k1.value + k2.value)*(k2.time - k1.time)/2; } accum += (spd.value + spd.key(i-1).value)*(time - spd.key(i-1).time)/2; }else{ accum = spd.value*(time - inPoint); } value + accum Here's where I'm at with my Python translation... from typing import Optional import c4d op: c4d.modules.graphview.GvNode # The Xpresso node doc: c4d.documents.BaseDocument # The document evaluating this node tp: Optional[c4d.modules.thinkingparticles.TP_MasterSystem] # Particle system def main(): global Output1 #Grab the host-object to the xpresso Tag Rect = op.GetNodeMaster().GetOwner().GetObject() #Get the UserData spd = Rect[c4d.ID_USERDATA,1] # Get the first animation track of the object track = Rect.GetFirstCTrack() # Get the animation curve of the track curve = track.GetCurve() # Get the number of keyframes on the curve n = curve.GetKeyCount() fps = doc.GetFps() sFrame= doc.GetMinTime().GetFrame(fps) eFrame= doc.GetMaxTime().GetFrame(fps) name = op.GetName() key = curve.GetKey(1) keyValue = key.GetValue() keyFrame = key.GetTime().GetFrame(fps) currentFrame = doc.GetTime().GetFrame(doc.GetFps()) value = spd if n > 0 and curve.GetKey(1).GetTime().GetFrame(fps) < currentFrame: accum = curve.GetKey(1).GetValue() * (curve.GetKey(1).GetTime().Get() - sFrame) for i in range(2, n): if curve.GetKey(i).GetTime().Get() > currentFrame: break k1 = curve.GetKey(i-1) k2 = curve.GetKey(i) accum += (k1.GetValue() + k2.GetValue()) * (k2.GetTime().Get() - k1.GetTime().Get()) / 2 accum += (curve.GetValue(curve.GetKey(i-1).GetTime()) + curve.GetKey(i-1).GetValue()) * (currentFrame - curve.GetKey(i-1).GetTime().Get()) / 2 else: accum = Input1 * (currentFrame - sFrame) print(Input1 + accum) Output1 = value + accum - There are loads of unnecessary variables in there btw - that was me just trying to figure this stuff out! Basically trying to drive rotation without using time as my driver. Now, I'm no programmer (as you'll soon find out!), but the attached project does work, but doesn't do what I want it to! When the UsrData 'speed' gets to 0 it should stop. And the rotation is meant to be smooth ramp up and then smooth ramp down. Any python geniuses out there got time to take a look and tell me where I'm going wrong? Smooth_Rotater.c4d
×
×
  • Create New...

Copyright Core 4D © 2024 Powered by Invision Community