Jump to content

jed

Limited Member
  • Posts

    2,189
  • Joined

  • Last visited

  • Days Won

    66

Everything posted by jed

  1. Strictly speaking, I should have set the tag node type to align to spline, not all (there's a massive list). you should buy one of these never Google your own name . . .
  2. XPresso tank track with hierarchy align to spline tag https://www.dropbox.com/s/4f1jvjunz4tw2s2/tank_track.c4d?dl=0 sorry about DropBox - I've run out of upload space.
  3. The Math:Add node, with datatype set to string will join the 2 (or more) string inputs to make one string output (like + for concatenation in Python). The LHS of the XPresso window also has handy system presets such as right string, length string etc.
  4. I think your sweep objects are in the wrong order. Top down it should be profile, spline. https://www.dropbox.com/s/m6tsr6p7r58z8uj/helix2.c4d?dl=0
  5. I've got a little python script that I use for smoothing stuff. Try putting the python node (and the control) between strength and the rest of your code. It subtracts the output from the input and adds a % (say 10-25%) of the difference to the output, so the output approaches the input in a smooth fashion. There's a slider for smooth amount. In this demo I use the Y of two text objects to show the input + output levels and noise to simulate the sound file. https://www.dropbox.com/s/7vonrndaqvt7734/smoother.c4d?dl=0.
  6. jed

    Python lists

    Counting 0, 1, 2, 0 etc is modulo. I think this does what you want, but the timeline must be running (or F > 0) https://www.dropbox.com/s/p3ilwgb56lzifvm/python_modulo.c4d?dl=0 button is bool input, count is output def main(): global previous, count frame = doc.GetTime().GetFrame(doc.GetFps()) # get current frame if frame == 0: previous = 0 count = 0 if previous != button: # if previous not equal to current count = (count + 1) % 3 # increment, % is modulo previous = button
  7. A quick Google tells me that there's no case in Python, and that folk use if/elif or dictionaries. Meanwhile, here's a GoTo joke.
  8. Not sure I understand the question, but I don't think you need the brackets. My precedence cheat sheet - Highest precedence ( ) (anything in brackets is done first) ** (exponentiation) -x, +x *, /, %, // +, - relational operators: <, >, <=, >=, !=, == logical not logical and logical or Lowest precedence also this one is handy time = doc.GetTime().Get() # get current time frame = doc.GetTime().GetFrame(doc.GetFps()) # get current frame
  9. You might find ny Python for noobs tutorial amusing - it's a random lottery number generator link. Given the time of year, maybe my Merry Xmas tubular bells machine merits a plug also link . Runs on Python and Nitro4D's SoundFX.
  10. You'd think that after using round, that the int would be unnecessary, but I had problems with a complete revolution sometimes showing 360 not 0. Using int and round seemed to fix this. Might have been a floating point thing - sometimes FP math gives unexpected results. The modulo operator and negative numbers is also interesting - I tried replicating the code in XPresso and got different results. Modulo means get the highest number divisible by the modulo, then calculate the remainder. Eg for -20 deg modulo 360 : XPresso says the highest number divisible by 360 is 0, so -20 % 360 = -20 Python says the highest number divisible by 360 is -360, so -20 % 360 = 340 [well this is my analysis of it] so Python gives the number you wanted without any extra math. You might want to google output formatting to adjust your output decimal places. https://www.dropbox.com/s/hrdvki6q9i3fr6k/modulo_anomaly.c4d?dl=0
  11. Try this - 2 lines of Python https://www.dropbox.com/s/5eqe7b0f5hhaif5/header_angle_python.c4d?dl=0
  12. Here's my video contribution to Xmas - a seasonal tune played on my tubular bells rig. Python/XPresso breakdown to follow. uses Nitro4D SoundFX, tube sound from Cubase
  13. If you subtract header degrees from 270, it remaps to 0-360 https://www.dropbox.com/s/58ea77tjhm7k4kz/doing_a_360.c4d?dl=0 sorry about the DB - run out of upload space edit - I just tried using range mapper with your numbers - it works and I can't reproduce your problem https://www.dropbox.com/s/oel9txq555r2c1i/rangemap_version.c4d?dl=0 maybe it's a radian thing - it's easy to get mixed up with conversions. XPresso uses radians, but when you use degrees in the GUI (or user data) it does the radian conversion for you. I prefer to stick to radians throughout - you can type pi or pi/2 in a GUI data field to get the correct value - pi/2 = 90 deg, pi = 180 deg, 2 * pi = 360 deg etc some calculations (eg wheel rotation) are easier using radians
  14. How about a house rule - all solutions must have an explanation. I recently posted an XPresso solution to someone's query, and the guy actually thanked me for including an explanation in the XPresso remarks. Explanations should be a matter of course. I know it's difficult to guess the poster's level of knowledge, and pitch an explanation accordingly, but you can cover all bases by aiming the info at beginner standard - there's folk reading this forum who only got C4D trial yesterday ! My particular blind spot is cloners and effectors. I've seen some amazing cloner stuff here, but haven't a clue how it works - no explanation. > All solutions must have an explanation < end of rant . . .
  15. I think this XP iteration does it - the planes use the nulls data. I renamed the objects to tell them apart. https://www.dropbox.com/s/jvzw1nfniz2ggre/transferred.c4d?dl=0 sorry about the dropbox - I've run out of cafe storage
  16. Here's a fun project I've been working on - still WIP. It's a prototype for a tubular bells instrument. Eventually it will have a proper diatonic 'keyboard', but this first attempt just has 5 tones to mimic London's Big Ben aka the Westminster chimes (often found on granny's favorite clock). The chimes were recorded using Audacity and a freeware virtual piano from ChordPulse. I used Nitro4D's SoundFX to trigger the notes by collision (easier than adding the sound in post !). The striker is Python driven, using a list of notes and durations. The center plunger is dynamic, and on a slider connector with a spring. A hidden cube hits it to make it strike the dynamic tubes, which are on hinges. Might amuse someone.
  17. I'll have to pass on this one - I still don't understand what the problem is. If lag is the problem, this is usually fixed by arranging the order of calculations. This can be adjusted by either changing the priority value for the XP tags - lowest is calculated first, or putting the XP tags on separate nulls in the object manager. The OM is calculated top down, so using method #2 you can visually see the order of calculation (and take into account other objects whose values may be required before an XP calculation can proceed correctly). If you leave the XP tags on the one null, I think they are calculated R > L. I've sometimes had to split an XP tag into 2 windows, so I could better control precedence using the order in the OM.
  18. TBH I don't understand the problem - maybe SolarPH could explain his objective ?
  19. jed

    Xpresso Nodes

    There are also some XPresso presets on LHS of the editor, that often get overlooked. I find the string manipulation nodes (left string etc) useful.
  20. This does a ripple type delay without mograph - I just multiplied the cube index to drive a memory node. ripple.c4d when you rewind to F0 you have to clear the memory node - hold down shift F
  21. TBH I'm not sure what the 'On' port does with objects (or any node) in XPresso. By trial and error, the only thing I've managed to turn on/off using this port is a Python script node. Maybe someone with more XP knowledge could throw some light on this.
  22. Whithers - 'On' seems to do something else, at least on my pc - works better with 'enabled'. switcheroo_2.c4d
  23. If you make the object rotate by adding a small amount say to B rotation every frame, this can easily be turned on or off (or even speed up/down). spin.c4d
×
×
  • Create New...

Copyright Core 4D © 2024 Powered by Invision Community