Jump to content

jed

Limited Member
  • Posts

    2,189
  • Joined

  • Last visited

  • Days Won

    66

Everything posted by jed

  1. If you make a sound node in XPresso with a play input port, and load a sound file, a 1 on this port (eg from a constant node) starts the sound playing. If the input reverts to 0 before the sound has finished it will clip it. The sound can be repeated with another 1. I haven't tested if this played sound renders* to avi etc - I usually record my robots going bleep etc in real time using Audacity and add the sound in After Effects. * edit - it doesn't, but you might find my 'record what you hear' method suitable
  2. jed

    Random Instance RIg

    You could use the index of the instances to change the seed of a random node, which would select a random object to assign to each instance. Something like this - Random_Instance2.c4d
  3. Do you ever get those days where you start thinking 'looks like I'll have to re-install C4D or Windows or both' ? Recently I had a problem with a disappearing sky, and after trying everything possible, I was about to throw in the towel when I found that disabling transparency on one of the mats fixed it. Sounds so unlikely that I did a screen grab - buildings from Pixel Lab, helicopter from free3d.com here's a WIP when you have eliminated the impossible, whatever remains, however improbable, must be the truth - Sherlock Holmes
  4. jed

    counter rotate

    Surely it's just local co-ords ? The child's net rotation is the difference between parent rotation and the child local rot eg if the child has -2X the parent angular velocity, it will turn at the same rate as the parent but in the opposite direction.. local.c4d
  5. I think dynamics and wheel suspension works best for cars on bumpy terrain. In this file I used ray collision to locate the target the car is following onto the surface. The base80 wheel only sees 'sea level' distance AFAIK, so doesn't react to height. When I used the base80 wheel with the unicycle on terrain, it was a bit of a con really (Roll-It reacts to distance on an incline BTW). terrain.zip
  6. @digitvisions and @everfresh thanks for the likes. I've jazzed up the 1st legoman so he has a hammer to whack the mole - here's the scene + code, if anyone wants to have a look - there's comments https://www.dropbox.com/s/tin82tjylbd35li/legomanmole.zip?dl=1 The Python clocks through some hidden placeholders that the mole jumps to when whacked, then a targeted null detects the angle to the mole, turns the vehicle accordingly and legoman sets off to get him. There's also a bit of camera target smoothing, and autozoom. Still WIP.
  7. This week's bit of Python WIP is legoman playing whack-a-mole. There's a null on the vehicle that targets the mole, then the vehicle turns by that H angle and heads for his quarry. When distance to mole is < some value, the mole jumps to a new location. The sounds are played by sending 1's to sound nodes from the Python at the relevant time. I recorded the sound in real-time using Audacity and 'what you hear' from my sound card, with 'all frames' in C4D off. The resulting wav was only out by 2 frames, which I fixed in After Effects using time stretch, so the sync's not bad, considering. If you don't already use Audacity audio editor, I recommend you check it out - it's free, and Windows + Mac. http://www.audacityteam.org/ might amuse someone
  8. Off-topic, but Wacom related - I recently got an entry level Wacom tablet + pen (23 x 17 cm £80) that I use with Windows Ink on a second monitor, to sketch out ideas, work out math, XPresso + Python etc and I don't know how I ever managed without it. Windows Ink is quite basic, but that's all I need - and it runs full screen. Comes free with Win10. > my $0.02
  9. Writing to user data is the way - I do this all the time. xptransfer.c4d
  10. jed

    The End of C.O.F.F.E.E.

    Maybe they'll bring Python up to date while they're at it.
  11. jed

    Radial Engine

    Nice - I like the cylinder block. I've just noticed that the other examples so far have an odd number of pistons - is that because of the order they fire ? Before I realized this, I had a go at a 12 cylinder version - the purple cylinder sleeves remind me of Marge Simpson
  12. jed

    Radial Engine

    Here's my attempt - I used 3D Kiwi's piston constraint method and made the cloner editable. There's often a lag problem with constraints and XPresso (for me anyway), but this isn't too bad - https://www.dropbox.com/s/es6q66oy4nptejt/engine2.c4d?dl=1 an interesting subject edit - I thought the offset center should move a bit more, so I added some sinusoidal rotation. There's a slider https://www.dropbox.com/s/k2lwzwsyw3n9fuc/engine3.c4d?dl=1
  13. jed

    Convert integer to string

    Default ports, when you make a new Python node, are float (real). You should remove the output port (double click) and make a new one, type string. This caught me out when I first used Python. I'd got into bad habits due to using XPresso, where anything can be connected to anything. Python is fairly strict in this matter.
  14. Me personally - no, but is it possible - yes. There's a bit of a hole in my Python knowledge when it comes to creating objects using code. I've seen posts here and at CG talk on this topic. My current Python method is reference objects in OM and user data > do math in Python > write vectors for position and rotation which more or less does what I want at the moment. There's usually a bit of Python in the weekly TDMS - well worth the 10 euro pm IMHO.
  15. Since you like my XPresso camera tricks, here's 2 more. There's a constant zoom scene, where I keep an object the same size in the camera viewfinder, and a smooth camera target scene that is useful for following a jerky subject. In fact, I use the smoothing method to smooth ordinary data all the time - if you look in my legoman python it's buried in the code. morecameratricks.zip
  16. I was watching video 4 from the TDMS series today - the wheel and ray collision - and I came up with this. It's basically the same as the tutorial, but using base80's magic wheel so that the wheel can go in any direction and still turn correctly - a bit like Roll It. I've put the base80 scene in the zip file. might amuse someone rolling.zip
  17. @szender If you use a hierarchy node, you can use the order that the objects are in the object manager. Also, it's flexible so you can add or remove objects. order2.c4d
  18. A link list has an index in port, to reference objects. In this file I used an object node as the specimen object, so I could get X position and name. linklist.c4d
  19. As they say on kids TV - here's one I made earlier
  20. Not sure where the 44 fits in, but I think this file does what you want ie it turns the 2nd wheel by 44 degs from 90% > 100 %. There's a readout for the 2 rots, and a user data control to turn 1st wheel. Remember that XPresso uses radians not degrees. turn44.c4d
  21. 2nd answer 1st - saving data in user data. Here's an interesting idea I got from a guy called base80 : In XPresso there's a node that can measure the length of a string ie how many characters (including spaces) are in a phrase. But what if the phrase was 'this phrase has 35 characters in it' and you were getting the '35' from XPresso? That would mean connecting the output from the 'length' node at the end the chain of nodes, back to the input at the LHS. Output to input is not allowed in XPresso, because it would create problems, especially for noobs - but looping in programming is one of the most powerful tools. The answer is what base80 called his 'dirty proxy trick' - you get the length from the node, write it to a user data value (at the end) and read it back (at the start). See file https://www.dropbox.com/s/ax4dbteq3ayve7f/base80trick.c4d?dl=1 Using math add, I've made the string 'this phrase has 29 characters'. The '29' is auto generated. If you edit the 1st string to read 'did you know that this phrase has ... etc', and either press 'a' to reload (or jiggle the playhead) you get 'did you know that this phrase has 47 characters'. That should amuse you while I write some Python for your 1st question.
  22. I got lost on question 1. Is object C different to object A ? A = A + B is a loop C = A + B is addition Making the loop scenario only execute when the value to be added changes is easy in Python. make a user data value (real, with no limits) and write to, read back etc.
  23. jed

    optical illusion

    So what's your definition of optical illusion ? To me it's just a bit of deceptive geometry that confuses the brain. You video don't have any ambiguity - looks like a regular animation to me. I do realize that everyone's brain works differently ie some people can't see some illusions. Here I've a stab at the old hollow cubes thing - the cubes flip for me, so is that not an optical illusion either ? I think the trick here is lack of perspective (I used a parallel camera). I used Python to swap the colors - sledgehammer/nut etc. https://www.dropbox.com/s/pudtcdey6i631ln/cubes.c4d?dl=1
  24. jed

    optical illusion

    couple as in 3 . . .
  25. jed

    optical illusion

    LOL - I read 'em all, Guardian, Sun . . .
×
×
  • Create New...