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?
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.
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?
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.
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.
Thank you @m_adam
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.
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:
thisMarker = thisMarker.GetNext()
#Get a list of markers
markers = GetMarkers(doc)
#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)):
@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.
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.
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?
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.