Navigation

    • Register
    • Login
        No matches found
    • Search
    1. Home
    2. reubenlara
    R

    reubenlara

    @reubenlara

    0
    Reputation
    9
    Posts
    3
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    • Profile
    • More
      • Following
      • Followers
      • Topics
      • Posts
      • Best
      • Groups
    reubenlara Follow

    Best posts made by reubenlara

    This user hasn't posted anything yet.

    Latest posts made by reubenlara

    RE: R25 doesn't register the [c4d.ID_BASEOBJECT_COLOR] parameter

    @m_adam OK this is really weird. I tried this over and over yesterday for several hours. this morning it is working fine! It must have been a case of restarting my machine or something. All set on my end! Thanks for testing either way, much appreciated!

    posted in Cinema 4D SDK •
    R25 doesn't register the [c4d.ID_BASEOBJECT_COLOR] parameter

    As you can see from the attached image, R25 won't highlight the following parameter:

    [c4d.ID_BASEOBJECT_COLOR]
    

    I'm using this to programmatically change the Display Color of a null, but it doesn't highlight in orange in either the Script Editor (when I type it) or the Script Log (when I manually change the color to trace a call), and since it doesn't recognize it, it throws an error. The same script highlights orange and runs fine in R23. Unless I'm missing something, I believe this is a bug?

    c4d-ID_BASEOBJECT_COLOR.png

    posted in Cinema 4D SDK •
    RE: Python "undo" changes the original selection order

    @m_magalhaes ah ok thanks for the clarification. So, at this point, you can confirm that this is a bug and not a mistake in implementation on my part?

    posted in Cinema 4D SDK •
    RE: Python "undo" changes the original selection order

    @m_magalhaes Excellent thank you! Will you post the results here? Or is there a another link I should follow?

    posted in Cinema 4D SDK •
    Python "undo" changes the original selection order

    Hello! My script relies on selection order and works fine. however, when I undo and run the script again immediately, the selection order is changed (somewhat reversed), and it toggles the reversal consistently. Why is it doing this? And is there a way to make sure the selection order stays constant when re-invoking the script?

    You can see a clearer explanation of my problem:
    in this brief screen recording

    import c4d
    from c4d import gui
    
    def main():
    
    
        doc.StartUndo()
    
        selected = doc.GetActiveObjects(c4d.GETACTIVEOBJECTFLAGS_SELECTIONORDER)
    
        #print order of object names to console
        print ("start:")
        names = []
        for obj in selected:
            names.append(obj.GetName())
        print (names)
    
        #distribute objects
        for idx, ob in enumerate(selected):
            doc.AddUndo(c4d.UNDOTYPE_CHANGE, ob)
            print (ob.GetName())
    
            ob[c4d.ID_BASEOBJECT_GLOBAL_POSITION,c4d.VECTOR_X] = 0
            ob[c4d.ID_BASEOBJECT_GLOBAL_POSITION,c4d.VECTOR_Y] = 0
            ob[c4d.ID_BASEOBJECT_GLOBAL_POSITION,c4d.VECTOR_Z] = 0 + (idx * 1000)
    
    
        c4d.EventAdd()
        doc.EndUndo()
    
    if __name__=='__main__':
        main()
        c4d.EventAdd()
    
    posted in Cinema 4D SDK •
    RE: Detect unicode character keypress in a Python script

    Ah yes thank you so much!

    posted in General Talk •
    RE: Detect unicode character keypress in a Python script

    @m_magalhaes Thank you! In your example of "Check for specific key pressed", instead of "c4d.KEY_F10", how can I can I check for a character key? I'd like to use GetInputState vs. GetInputEvent for my specific script.

    posted in General Talk •
    RE: Detect unicode character keypress in a Python script

    @reubenlara For that matter, maybe I'm going about it the wrong way with "BFM_INPUT_ASC"? How would I detect normal letters? Thank you!

    posted in General Talk •
    Detect unicode character keypress in a Python script

    Hello! I've successfully been able to detect modifier keys for my Phyton script, but can't figure out how to use "BFM_INPUT_ASC" to detect the letters "x", "y", and "z" (or any other character, for that matter). Where can i query this within the code below? Thank you!

    pressedKey = 'none'
    bc = c4d.BaseContainer()
    if c4d.gui.GetInputState(c4d.BFM_INPUT_KEYBOARD,c4d.BFM_INPUT_CHANNEL,bc):
        if bc[c4d.BFM_INPUT_QUALIFIER] & c4d.QSHIFT:
            print("SHIFT PRESSED")
            pressedKey = "shift"
        if bc[c4d.BFM_INPUT_QUALIFIER] & c4d.QCTRL:
            print("CONTROL PRESSED")
            pressedKey = "control"
        if bc[c4d.BFM_INPUT_QUALIFIER] & c4d.QALT:
            print("ALT PRESSED")
            pressedKey = "alt"
    
    posted in General Talk •