Jump to content

Sign in to follow this  
mrittman

Sound Track - Start Time

Recommended Posts

  • Topic Author
  • I simplified it a bit so that the python xpresso node references the object name it's attached to. It's working great now! I really just wish the Start Time was built into the Sound Effector, and I wouldn't have had to mess with all this hah!

    python.png

    xpresso.png

    user data.png

    Share this post


    Link to post

    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

    Share this post


    Link to post
  • Topic Author
  • Oh that’s interesting, thanks for sharing man! Maybe instead of having 15 different sound effectors, I could just have 1. Then have a select box to choose which one to play? Then yeah, could also output the filename if need be.

     

    What I find kind of frustrating is when working with the Take System. When creating a new Take, it doesn’t show the waveform in the timeline, and I have to go back to the Main Take to see it. At least having this system we’ve set up let’s ya adjust the Start Time when under child Takes.

     

    I think I’ve spent way too much time on this lol. It’s the perfectionist nature in me :/

    Share this post


    Link to post

    I've never used takes.

     

    Is that dropbox file something like what you had in mind ?

    Share this post


    Link to post
  • Topic Author
  • 1 hour ago, jed said:

    I've never used takes.

     

    Is that dropbox file something like what you had in mind ?

    Oh man Takes are awesome if you've got a scene that needs a bunch of animation. Before Takes, I would have to break my C4D project into several files. Now I can do it all within one file.

     

    Oh shoot, my bad, I didn't see the dropbox link! I'll take a look!

    Edited by mrittman
    dropbox link

    Share this post


    Link to post
  • Topic Author
  • Wow, I feel dumb...didn't know there was a python tag haha! Yeah man this is a nice little setup!

     

    You've definitely got a lot more experience with this coding stuff than I do. Takes me a lot longer to get my head around.

     

    Thanks again!!

    Share this post


    Link to post
  • Topic Author
  • Instead of using a Float slider for the start time, how would you use just a Time data type? The console keeps throwing back this when I output the Time data type:

     

    <c4d.BaseTime object at 0x14b15b948>

    Share this post


    Link to post

    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

     

    error.png.7146975e1297347363cfd354aa1c7067.png

     

    the usual fix for that is 'if xyz :  return'

    Share this post


    Link to post

    oops cross posting - can you show the code for the time problem.

    Share this post


    Link to post
  • Topic Author
  • Yeah, I was just trying to use the Time data type, as it just makes it easier to position on the timeline, but it's outputting that crazy value:

     

    <c4d.BaseTime object at 0x14b15b930>

    time.png

    Share this post


    Link to post

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Reply to this topic...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    Sign in to follow this  

    • Recently Browsing   0 members

      No registered users viewing this page.

    ×
    ×
    • Create New...