Jump to content

jed

Limited Member
  • Posts

    2,189
  • Joined

  • Last visited

  • Days Won

    66

Everything posted by jed

  1. Works for me in R20/21. Maybe you have the indents not aligned ? import c4d def main(): for x in range(10): # Loops 10 times c4d.CallCommand(12414) # Goto Next Frame if __name__=='__main__': main() indent is 4 spaces - use tab
  2. jed

    Lego Plug-in

    I think this is the d/l link leads to this DropBox there's a lib4d file and csc file, but I'm not sure what the csc is for. Google translate
  3. Swap that object node for a math add, and keyframe the amount added. You can tweak the slope etc in dopesheet. I'm not sure what the object node is supposed to do...
  4. If you generate the Z by addition instead of multiplication, the amount added is the 'speed' which can slow down, stop, restart etc. I have a python node that I use a lot for rotation, speed etc. Here's the all XP, and the python node versions timeline_xp.c4d timeline_py.c4d def main(): global Output1 frame = doc.GetTime().GetFrame(doc.GetFps()) if frame == 0: Output1 = 0 else: Output1 += speed * multiplier you could use a trig node for the rangemap sine wave
  5. Alberto y Lost Trios Paranoias - Kill, on YouTube here 70's comedy punk band...
  6. I think this does it def main(): control = doc.SearchObject('control') top = doc.SearchObject('top') text = doc.SearchObject('MoText') delay = control[c4d.ID_USERDATA,1] track = control[c4d.ID_USERDATA,4] track -= 1 sn = top.GetChildren() count = len(sn) titles = ['No Track', 'Albertos - Kill', 'Ottawan - DISCO', 'Police - Roxanne'] for a in range(count): t = sn[a].GetFirstCTrack() if a == track: t[c4d.CID_SOUND_ONOFF] = 1 t[c4d.CID_SOUND_START] = c4d.BaseTime(delay) else: t[c4d.CID_SOUND_ONOFF] = 0 t[c4d.CID_SOUND_START] = c4d.BaseTime(0) text[c4d.PRIM_TEXT_TEXT] = titles[track + 1] I couldn't seem to get the int cycle to accept -1 as NONE, so I subtract 1 from track. The 'if a == track' misses it because range starts at 0, so sets all tracks to disable. Then added 1 to track for text readout.
  7. What data type is the track name ?
  8. you can also replace the RHS of t[c4d.CID_SOUND_START] = c4d.BaseTime(delay) with the time user data value
  9. I'm guessing that although the time user data shows frames, it's converting that value into a c4d base time unit - similar to when you dial in degrees but XP converts them to radians. If you want to use frames as time, make an integer user data and convert it to time as per 1st file delay_secs = delay_frames / doc.GetFps() you could just type in the fps, but beware integer division 10 / 30 = 0 10 / 30.0 = 0.333 etc in 1st file, input port was real, so integer frames input was converted to float.
  10. oops cross posting - can you show the code for the time problem.
  11. Python nodes and tags have their own advantages. If you have a lot of objects to read from and write to, but hardly any number crunching, a python node is quicker to set up - just click some wires as opposed to typing many doc.SearchObject(), ditto writing data etc in a tag. One little glitch with python nodes, is that sometimes a node doesn't work because there's no output port connected. I've never managed to isolate the actual conditions when this happens, but I usually have a redundant output connected 'just in case'. In the 1st file, there was a remark 'leave this connected' - force of habit. When editing python, a lot of people click compile and if it says 'no errors' think that's it. You should also check menu > script > console for error messages. In the dropbox file, if you try to select more tracks than are loaded you see this in console the usual fix for that is 'if xyz : return'
  12. I've never used takes. Is that dropbox file something like what you had in mind ?
  13. I tried dragging 'use sound' into the python window and it seems that value is accessible. If you load several tracks, you could select which one to play, and maybe output the corresponding filename eg from a list of strings. sn = doc.SearchObject('soundnull') sn2 = doc.SearchObject('soundnull.1') t = sn.GetFirstCTrack() t2 = sn2.GetFirstCTrack() t[c4d.CID_SOUND_ONOFF] = 0 # 1 = play t2[c4d.CID_SOUND_ONOFF] = 1 edit - something like this dropbox
  14. No, sorry. If you look at the MAXON page on special tracks here , you'll understand my quip earlier about my trial and error method. I find the SDK v hard going, so I usually try 'drag and drop' a data field into the Python window. This often results in usable code, with a bit of editing. It worked for the start time field, but when I tried with the sound file, it mysteriously said my music.wav file was called '10.0'.... You could ask at CG Talk or the C4D Plugin Cafe - the latter has some very tech types, but they also speak in Klingon code-speak. https://forums.cgsociety.org/c/software/MAXON-cinema-4d https://plugincafe.MAXON.net/ code joke
  15. Cubase Elements is amazing value at about £85 UK.
  16. Yes, no scrubbing. When it comes to triggered sounds, I've had some success using Audacity to record in real time. If the track length doesn't exactly match, AE has time stretch.
  17. I'm not sure how to swap tracks the way you suggested. Is it essential to use timeline sound ? The regular sound node is easier to program ie start time, swap tracks. AFAIK it doesn't render, but there's ways around that - eg record 'what you hear' in real time and add it in post. See snip
  18. This uses a python node kill.zip and I used trial and error...
  19. jed

    Zero Theorem

    I was watching this kinda dystopian film last night, where a lot of the population had to sit front of screens all day, connected to a master mainframe, and solve mathmatical, graphical puzzles. The puzzles were based on cubes - see snip of 2 typical screens I thought 'sitting in front of a screen all day, looking at cubes - hmmm, this sounds familiar...' film was The Zero Theorem (2013) https://www.imdb.com/title/tt2333804/
  20. jed

    Porting ArrowTool to R20

    If you go menu > script > console, that's where python prints error messages (and non-error prints). It says that's because you had a circle plugged in. Make it editable ie a spline, and the yellow goes away. When you click compile on the python window, and it says OK, it's really just a simple syntax check.
  21. jed

    Porting ArrowTool to R20

    I think I've fixed it def main(): global Output1, Output2, Output3, Output4 if pos == 4: Output1 = 0 Output2 = 0.5 + twist Output3 = 1 Output4 = 0.5 if pos == 5: Output1 = 0 Output2 = 0.5 Output3 = 1 Output4 = 0.5 + twist import c4d from c4d import utils #Welcome to the world of Python def main(): global Output1 if not SplineObj: return blah = utils.SplineLengthData() # blah = dummy var blah.Init(SplineObj) # name of spline Output1 = blah.GetLength() arrowTool_0001.c4d I'm not too sure about this line ' sld->Free(); ' let me know if it works ok edit - according to lesterbanks, the line I was unsure about would be blah.Free() # free up memory used by new spline class instance might be required...
  22. I found that adding a field made this work - although I'm not sure why
  23. jed

    Scaling Question

    Sorry - don't understand. Give numerical examples.
  24. jed

    Scaling Question

    Are you changing the ref plane uniformly or per axis, by size or scale? Are the other 2 going to keep their aspect ratio ?
×
×
  • Create New...