Jump to content


Sound Track - Start Time

Recommended Posts

What data type is the track name ?

Share this post

Link to post
Share on other sites

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)
            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.

Share this post

Link to post
Share on other sites

Alberto y Lost Trios Paranoias - Kill, on YouTube here


70's comedy punk band...

  • Haha 1

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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.

  • Recently Browsing   0 members

    No registered users viewing this page.



C4D Cafe is the largest CINEMA 4D community. We provide facilities for discussion, showcasing and learning our favorite software :) Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, get your own private messenger, post status updates, manage your profile and much more. If you need to find solution to your problem or otherwise ask for help, Cafe is the right place.
  • Create New...