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
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.
@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.
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 . . .
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
@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.
@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
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.
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/
def main():
global Output1 # and the rest
if Input1 == 0:
Output1 = True
Output2 = False
Output3 = False
Output4 = False
Output5 = False
Output6 = False
Output7 = False
else:
Output1 = False # etc
note it's case sensitive, indent and colons. Outputs must be global, but can be declared on one line separated with commas
true.c4d
Here's 3 splines of different lengths, using spline wrap. You can measure the spline length to get the same speed on each spline. If you have a zillion arrows + splines, hierarchy iteration would be better.
3splines.c4d
edit - as per CBR's idea, cloner version
3cloners.c4d
some ideas for you
I had my first play with the R19 sound effector today, and although I'd read about the sound file automatically showing in the timeline dope sheet, I didn't realize the sound was embedded when you save the file. If you look in the file sizes in this screenshot where I've tested using mp3 and wav, it seems mp3s are converted to wavs in Cinema. The R19 sound effector isn't backwards compatible - giving missing plugin error message when R19 file opened in R18 etc.
You can see the actual program code for the screen size site calculation in the html. In Firefox the page code is found in menu, tools, web developer, page source. It's not Python, but might be of some help.
The read-write to user data delay is not the problem IMHO. Since you have 4 variables, you'd have to specify which values were 'held' while the other values are typed in. In this file I have 2 selections choices - enter width + height or enter diagonal length + aspect ratio. It's in Python, but should convey what I'm talking about.
ARtest.c4d
sorry about using script, but I needed a rounding function. There's comments (in green) . . .
You could also use the state output of a one-shot monoflop and a rangemapper to draw your own custom barrel movement curve. State gives a linear 0-1 ramp in time 'duration'.
Recoil2.c4d
@HSrdelic - it's not every day you get to use arc tangent in Cinema