Jump to content

jed

Limited Member
  • Posts

    2,189
  • Joined

  • Last visited

  • Days Won

    66

Everything posted by jed

  1. Works for me. Are you clicking compile and using 'math dot sin' ? Check menu, script, console for any Python error messages. You do know that Python + Xpresso both use radians ? 360 deg = 2 * pi radians
  2. I was reading up on epicyclic gears at Wiki here. The math at Wiki was a bit hard, so I thought it easier to build a model in C4D and experiment. I got a bit carried away... the soundtrack was made using this , Lego Man model by Rob Redman Lman.zip
  3. I had another look at animating the Windows spinning dot thing today with Python. In this version I animated one obj and made 2 history lists for position and visiblity. The other objs read off 5th, 10th, 15th value etc and so follow the 'master', but with delay. I tried using 'c4dcafe', and it kinda works - but too many letters maybe cafespin2.c4d I did the gifs in Photoshop.
  4. I use this renamer pack - OK with R20 http://www.lasselauch.com/c4d-script-c4d_renamer-pack/ on Windows, goes here C:\Users\jed\AppData\Roaming\MAXON\Cinema 4D R20_4FA5020E\library\scripts\C4D_Renamer-Pack_v1.1
  5. I dug out one of my old animations - 'We wish you a merry Christmas' played on tubular bells. I think I used Nitro4D's SoundFx to trigger the sounds. just a bit of fun
  6. I use modulo a lot, eg if I want to trigger some event every 10F I use if frame modulo 10 = 0 <do something> pseudocode
  7. I don't understand your maths, but this is how I'd do 2 oscillating lights 2lights.c4d edit - probably should have been >= not >, but you get the idea
  8. I was asked by a member for XPresso ideas to drive a clock sweep second hand, so I've zipped up a few scenes that might interest anyone learning XPresso. I used modulo to get the second pulse, a monoflop as a counter and delay effector for a small overshoot and wobble on the hand. In one file there's a ticking sound, but you can't really export sound easily in C4D, so my method is to record the sound in real time in Cinema using Audacity set to 'what you hear', and add it in After Effects. In the past when I've used the Audacity method on big scenes, the sound track can end up longer than the animation, but AE has tools for shrinking tracks. In this clip I exaggerated the hand overshoot to show the effect (has sound) - it's not rocket science, but might help XPresso beginners second_hand2.zip
  9. @madmarvin - regular collision needs objects to be polygons, but dynamic collision node also works with primitives. Depending on scene, dynamic collision often only needs one object input eg 'has object A collided with anything'.
  10. The file on that page gave an error messaged 'too old for R20', so I opened it in R19 and resaved. It seems to work the same in R20 as R19. r20-DelayCamera.c4d
  11. The emitter seems to get detected with dynamic collision node. xpresso_button_flip2.c4d
  12. There's a couple of Python target presets in XPresso window, System Presets, Calculations - you might get some ideas from there. In < R20, I think all that stuff was in COFFEE.
  13. Everything's connected to everything in this file. It's not very elegant, but works with random effector. You might be able to modify it to suit your needs. joincubes.c4d
  14. How many connections - is every cube connected to every cube ie 5 cubes = 10 splines ? Probably doable with iteration. Tracer will connect all objects under a fracture with one spline.
  15. @Havealot I'm sure you're correct, but I'm not all that good at mograph (read : world's worst). I initially tried using a cloner and accessing individual clones with formula effector id, but couldn't seem to make the values stick when moving to the next clone. I know it's a bit defeatist, but I usually find it easier to make a cloner editable and write some iteration in Python or XPresso. Re fields - I'm still trying to work out why this sound effector needs a field to work - even when there's nothing in the viewport.
  16. I was watching Big Bang Theory on TV, and one of the guys had a T-shirt that looked a bit like a reflected audio volume display - probably is something else, but I thought I'd have a stab at replicating it in C4D. As per my usual methodology, I tried using mograph but couldn't get it to work - so I made the cloner editable. There's 400 cubes and frame count is set to modulo 400, referencing the objects sequentially in a sweep. Sound effector gives the Y size - for some reason it needed a field to get an output. Previous sweep gets overwritten (a bit like hospital machines). I chose a soundtrack that has some suitable guitar 'ching' to give something to look at - most pop is highly compressed. It's not rocket science, but might interest someone learning XPresso. R20 scene https://www.dropbox.com/s/odrff8qi6d7eyxn/vol5.zip?dl=1
  17. Try using just one iteration node to drive things.
  18. Any scene with a large number of objects usually means mograph cloner (+ random effector for the variation). My knowledge in Mograph is a bit lacking, but there's plenty of experts here that can help you. Re your original plan - I agree that dragging 1000 mats will be a hassle, but if you select all the objects and go tags > texture to give them all a blank tag, then make a similar number of mats, you can assign them with python. See before and after in these 2 scenes start.c4d end.c4d there's comments in the python You might find processing 1000 mats with noise too much for your pc...
  19. If each object has a mat with different luminance, you're going to need 1000 mats. I don't think the same mat on all the objects can have different values simultaneously. That said, here's 5 cubes with 5 mats. I used object index to give each mat a different seed. xpnoise.c4d
  20. Convert data to string def main(): global info a = 123.45 # numerical data info = str(a) Python port must be data type string edit - in XPresso, looping an output port back to an input at the start of a chain of nodes is generally not allowed. If the wire does not go green when you try to connect, this is the problem. Otherwise, Python errors are displayed in the console. Post the scene so we can have a look.
  21. the perils of GOTO comes back to bite you...
  22. The object list outputs an instance of each object in the list, in order, once every frame. The cube is a representative object. Connecting the instance to the object input port changes the specimen object to the instance - one at a time. Anything you do to the specimen object (scale etc) applies to all objects in the list. enable_all.c4d hint - when making an object list (or similar), set the little padlock to locked. The list window has a habit of disappearing when you click away.
  23. It's to do with global and local variables. Local variables exist in def main, but to write values to the output port they have to be global - so they can exist outside def main. In a similar manner, any 'counter' type variable that increments every frame needs to exist outside of def main - it needs to be global so it persists when the code is run the next frame. This will count def main(): global counter frame = doc.GetTime().GetFrame(doc.GetFps()) if frame == 0: counter = 0 else: counter += 1 print counter so your code would be something like def main(): global red, blue, yell, counter frame = doc.GetTime().GetFrame(doc.GetFps()) if frame == 0: red, blue, yell = False, False, False counter = 0 else: if frame % f1 == 0: if counter < 3: counter = counter + 1 red = not red blue = False print counter elif counter > 3: counter = 0 although I don't think the last part gets executed
  24. Try this - when red + blue are off, yellow flashes. I've used frames not Hertz - easier math until logic sorted out. flash2.c4d
  25. I'm not really sure what sequence of lights you want. You could try inserting print statements to troubleshoot your logic. Print output is in the console, menu > script > console for example print (frame / 6) % rate then use keyboard G to step through the scene one frame at a time
×
×
  • Create New...