Navigation

    • Register
    • Login
        No matches found
    • Search
    1. Home
    2. gsmetzer
    G

    gsmetzer

    @gsmetzer

    0
    Reputation
    28
    Posts
    47
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

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

    Best posts made by gsmetzer

    This user hasn't posted anything yet.

    Latest posts made by gsmetzer

    RE: Trim a bitmap

    Thank you for the code. Very interesting and will come in handy.

    "Or do you want to create a polygon that only shows the relevant part of the bitmap? The last case can be achieved by simply adapting the polygons's UV coordinates."

    Yes, I want to have the bitmap with as little excess polygons around it as possible. A quad rectangle is fine as it needs to calculate fast.

    Is there a python way to adapt the uv coordinates for a similar effect?

    posted in Cinema 4D SDK •
    Trim a bitmap

    I want to get the width/height dimensions of the triangle in my bitmap in order to trim away as much alpha in my image as I can and create a polygon tight around the triangle. See Image. Basically the same function as a Trim command in photoshop. Is there an ability to do this in C4D? Maybe with GeClipMap? How would this look in code?

    Thank you for any guidance here.
    Screen Shot 2019-12-01 at 11.46.41 PM.png

    posted in Cinema 4D SDK •
    RE: Changing CUSTOMGUI_RANGE

    Thanks for the info. I'm using R19 and haven't tested on newer releases so its possible .res access to CUSTOMGUI wasn't available in R19 for RangeData...

    If I can change the CUSTOMGUI's in my python file how do I do that? I have been searching around trying to find some sort of code but coming up empty handed. Handling Description ID's is pretty simple for UserData but not for an ObjectData plugin. Any code or tutorials on how I can customize my gui from my python file in my ObjectData plugin?
    Thank You,

    posted in General Talk •
    Changing CUSTOMGUI_RANGE

    I am nearly done with my command data plugin but I have one final issue.
    I have a RangeData Slider and I want to adjust the interface. In the .res file the only CUSTOMGUI function that is recognized is: ANIM OFF and RANGE_CURSORICON (that I can figure out)
    However I need to customize the RangeData with RANGE_ALLOWRANGEEDIT and RANGE_ALLOWRANGESLELECION. See this link for the RANGE_CUSTOMGUI options available.

    https://developers.maxon.net/docs/Cinema4DPythonSDK/html/modules/c4d.gui/BaseCustomGui/RangeCustomGui/index.html#c4d.gui.RangeCustomGui

    Can I update RANGE_ALLOWRANGESELECTION and other custom gui's in my .res file or can I do this in my .pyp file?

    I am using R19
    Thank you for any help.

    posted in General Talk •
    RE: Delete marker with python

    Thank you @m_adam

    markers[0].Remove()
    

    worked in the Python Generator without crashing. I hope it isn't stupid to try this. I do plan on converting it to a plugin. Thanks, you can solve this question.

    posted in Cinema 4D SDK •
    Delete marker with python

    Hello,

    I have a Python Generator with an integer UserData. My code functions by adding markers based on the integer from my user data. Adding markers is working as expected. However deleting markers does not. I can't find anything in the API that deletes markers from the timeline. How would I do this? The only other option would be to delete all markers with command data. My code:

    def GetMarkers(doc=c4d.documents.GetActiveDocument(), sort=True):
        markers = []
        
        thisMarker = c4d.documents.GetFirstMarker(doc)
        while thisMarker is not None:
            markers.append(thisMarker)
            thisMarker = thisMarker.GetNext()
        
        return markers
    
        
    def main():  
        
        #Get a list of markers
        markers = GetMarkers(doc)
        
        print len(markers)
        #check if my user data integer is greater/less than the number of markers 
        if len(markers) < op[c4d.ID_USERDATA,1]:
            c4d.documents.AddMarker(doc, None, c4d.BaseTime(len(markers)), 'name')
            print 'add Marker'
            
        elif len(markers) > op[c4d.ID_USERDATA,1]:
            #Removing or del from Markers list doesnt work...   
            print 'delete Marker'
        
        #Here I loop through the list and set the name,time, length, color etc. if needed
        for i in range(0, len(markers)):
            
            markers[i].SetName('fred')
        
        c4d.EventAdd()
    
    posted in Cinema 4D SDK •
    RE: Drag and Drop onto Range Slider

    @m_magalhaes My aim is to create a drag and drop interface so the user can drop an object between the knots of the range slider. The range slider would represent the timeline and each knot in the range slider an in-out edit point. Drag and drop is just a cleaner way to assign edit points to an object than iterating through a link list or inExclude list.

    SetEditorMode(c4d.MODE_ON)
    SetEditorMode(c4d.MODE_OFF)
    
    posted in Cinema 4D SDK •
    RE: Drag and Drop onto Range Slider

    Ok, I see, @zipit example finally got a message to work for me. (I'm still wrapping my head around the message system) Thank You Zipit.

    I'm not ready to dive into C++ yet. I would love to be able to use a PyCObject but it looks as though that may be a ways off for me.

    @m_magalhaes I am building an object list by dropping objects on the range slider and using the range slider's knot data to animate the object. The drag and drop would be a much cleaner way of building that list without using an InExclude or bunch of Link's.

    Looks like I will just use Link for now. If you know of any sample PyCObject code I would love to have a look. Thank you for the help.

    posted in Cinema 4D SDK •
    RE: Drag and Drop onto Range Slider

    I just want to get the object data from the object that is dropped on the slider. Thats about as simple as I can say it.

    It looks as though you can't pass any DRAG AND DROP message from the Range Slider.

    check = op[c4d.ID_USERDATA, 1].Message(c4d.MSG_DRAGANDDROP)
    

    Console: AttributeError: 'c4d.RangeData' object has no attribute 'Message'
    but works for a link object like you said earlier.

    Is there maybe a way to draw a GeUserArea with a drop area over the Range Slider?

    posted in Cinema 4D SDK •
    RE: Drag and Drop onto Range Slider

    Dragging into a BaseLink is just an example, I want to add the drag and drop freature simply for improved user experience.
    How do you know this isn't an acceptable operation? I get the drop box icon as I hover over the slider data. If this isn't possible I'll abandon this topic.

    posted in Cinema 4D SDK •