Jump to content

jed

Limited Member
  • Posts

    2,189
  • Joined

  • Last visited

  • Days Won

    66

Everything posted by jed

  1. Oneshot monoflop + state + rangemap + spline is a killer combination. Re the userdata trick - I got it off a guy called base80 who made this scene. It says 'this phrase has 29 characters', but the '29' comes from measuring the string length and inserting it in the message. If you change the message and refresh the screen (jiggle playhead etc) it updates the character count. Only possible with base80's proxy trick. base.c4d
  2. Using the result of a collision to block other collision triggers is tricky in XPresso because you are trying to loop an output to an input - which is not allowed in XP. There is a way around this by writing to user data and reading it back - which 'breaks' the loop. In this file there's a sphere bouncing on a cube (which reacts). After the 1st bounce, a 2nd monoflop with 100F duration writes a 1 to userdata, which is read back to temporarily disable further triggers for 100F. There's a 1F delay writing and reading userdata, but this works in our favor by not blocking the 1st pulse. Might do what you want. lockout.c4d
  3. You don't need to specify both objects for collision - just one will detect any object colliding with it. Is that what you meant ? After playing with your scene, I just had to go find Tommy - Pinball Wizard on YouTube. Showing my age here ...
  4. Clamp lower and upper seems to fix that. When not checked, the function can also calculate outside of the range.
  5. What sort of spline have you got on the range map ? I'd suggest something like this - or maybe
  6. @bezo re my radians protractor - was intended as a little joke. A lot of C4D users see the XPresso use of radians as an annoying use of a stupid unit. I mean 1 radian = 57.295 degrees ? 6.283 radians in a circle ? How can that even help things ? The old car wheel rotation calculation crops up here every now and then. I've seen people solve that little problem using pi, 360 degrees etc then converting the answer to stupid radians 'for XPresso'. I'm sure you realize that if you know the definition of a radian, the solution is just wheel rotation (in radians) = distance car travels / radius of wheel. engineers, physicists often refer to a right angle as 'pi by 2' . 360 degrees has its uses eg it divides by 2,3,4,5,6,8,9,10,12,15,18,20,24,30,36,40,45,60,72,90,120,180 from - print('divisors of 360') for a in range(2, 360): if 360 % a == 0: print(a, end=',') as we say in the UK 'it's horses for courses'
  7. I've reworked bezo's example - bezo.c4d oops - beat me to it
  8. Here's my take on it. I had a go at making a radians protractor using cloners, but couldn't seem to line things up. So I just did the math well, it is in the XPresso section . . . rad.c4d
  9. My wish list - being able to put Python-style comments in the OM, and a much larger clear screen button in the console
  10. jed

    C4D plays the sax

    I see my sax thing had a couple of 'likes', so here's the file if you want to have a look. The sax samples should be embedded. I know that other people's code is a hassle, but I've commented it. There's often a little code snippet you can pinch - it's how I learn Python. https://www.dropbox.com/s/pmrdr2j13jqnu03/saxthing.zip?dl=1 @Cerbera I only have the cut down Cubase Elements, but for £75 it's an amazing bit of tech. Thrown in a cheap usb keyboard, a low latency sound card and say Addictive Keys and you've got a 50 grand Steinway in your council flat.
  11. jed

    C4D plays the sax

    @Cerbera One thing that helped that little project was using Audacity (free audio editor). I clicked some notes in Cubase for the scale and exported it as one wav. Instead of then cutting the file to make all the separate wavs, Audacity has an intelligent 'sound finder' that marks out the sound and silence. Then you do 'export multiple' which cuts each part and labels it - see screenshot. The sax is a VST called DVS Saxophone.
  12. This was just a Python exercise, but it might amuse someone. Basically, it's a hidden sphere bouncing around inside a circle and triggering notes. The notes and timing are random, so if you watch it long enough, it should play Coltrane's Giant Steps a la monkeys and typewriters. Possibly . . .
  13. Would @jbatista like all the sub-folders displayed as well ? Would get a bit busy with things like the light object . . .
  14. The 10 page R19 hotkey pdf on that keyboard site is pretty awesome link.
  15. Works for me. You have to open render settings and drag 'my render settings' into the XP. The divides are div 2. If you set formula to radians you can omit the rad to deg node. camera.c4d you might have to refresh the scene, jiggle the playhead etc, to force a re-calculation
  16. A bit like this - speed.c4d edit: I added a start position slider speed2.c4d
  17. In the original post, @nicks refers to enable - which is different to visible.
  18. @fxtree - the object's visibility sticks when you take it out of the null. Just making the null traffic lights red would achieve the same thing, but 'hidden' would not stick when the object is removed from the null.
  19. Same poster, same question, same answer Feb 4
  20. jed

    coffee to Python

    @borg re: my last message about multiple assign ie assigning several values on one line a, b, c, d = 1, 2, 3, 4 etc this can be used to swap values eg a, b = b, a in this file I used that method to create the 'moving fairground lights' illusion (lights switched on/off in a pattern so they appear to move). I have 3 lights cloned around the object and the brightness pattern toggles a, b, c = b, c, a to give 'movement' cafelights.c4d
  21. jed

    coffee to Python

    I also use this method def main(): global Output1, Output2, Output3, Output4 if Input1 == 0: Output1, Output2, Output3, Output4 = True, False, True, False else: Output1, Output2, Output3, Output4 = False, True, False, False
  22. jed

    coffee to Python

    One of my on-going projects is python helicopters. In this file, start the timeline, then in the control panel adjust rotors, altitude, speed then steer. Might fly a bit slow if you haven't got a reasonable gfx card. https://www.dropbox.com/s/3fhnianc9jm4rx6/legohelicopter.zip?dl=1 it's not designed for making movies - just for fun in the viewport.
  23. jed

    coffee to Python

    @borg here's one of the first scripts I wrote. It generates 6 lottery numbers, and sorts lo-hi. Note the 'import random'. lottery.c4d
  24. jed

    coffee to Python

    Real and float are the same. One thing to remember with numbers is the way Python 2.7 (cinema uses an old version) treats integers different to reals esp in division. Integer division gives an integer result eg 3 / 2 = 1.5 in Python 3.5 (and IRL) 3 / 2 = 1 in Python 2.7 this can trip you up if you use current frame (an integer) in a calculation, but can be fixed by using 3.0 etc. I use the free Pycharm to develop script ideas - you have to install Python first. http://www.jetbrains.com/pycharm/ https://www.python.org/
×
×
  • Create New...

Copyright Core 4D © 2024 Powered by Invision Community