@ferdinand Great job!👍
Posts made by chuanzhen
Hi,
online and offline 2024 c4d python doc link error, not find file
@ferdinand Thanks,hope to fix spelling in c4dpython doc in future versions
Hi,
Previously, my plugin worked normally in 2023, but in 2024, the console prompted:
but,there have been no changes in the sample code for this section in the Python doc for 2024
I can only replace it with the number 2. “ menu.InsData(2, True) ”.Has there been any change in 2024?
@ferdinand Thanks for your detailed reply, it is helpful!
Hi,
How to get the Outlines of polygon objects, just like in the image.
Thanks for any help!
@ferdinand The code works very well :+1:
@ferdinand When I change the size of the dialog, the code will have problems in this area.
Modifying this part of the code ensures that even if the dialog size changes, there will be no issues
if self.CheckDropArea(gid, msg, True, True):
result.SetId(c4d.BFM_GETCURSORINFO)
result.SetString(c4d.RESULT_BUBBLEHELP, bubbleMsg)
break
@ferdinand Thank you for your detailed reply!
@ferdinand Your code works well, but I have another question to ask, why does open dialog in main() result in this effect(failed to create layout)
@ferdinand Thank you, this is exactly the effect I want because I couldn't find a method (GetDragPosition() and CheckDropArea()) to query whether the mouse position is on a gui element.
Hi,
i want to show text something when cursor in gui element.
But I can only display some text when the mouse is stopped, I hope different GUI elements display different text. (For example, if there are different buttons in a window, when the mouse is stopped, the information of the current button will be displayed.)
BitmapButtonCustomimGui can achieve this effect. How can button gui achieve this effect?
example dialog:
my code:
def Message(self,msg,result):
msg_id = msg.GetId()
if msg_id == c4d.BFM_GETCURSORINFO:
result.SetId(c4d.BFM_GETCURSORINFO)
result.SetString(c4d.RESULT_BUBBLEHELP, "Show something")
return c4d.gui.GeDialog.Message(self, msg, result)
Thanks for any Help!
Hi,
I tried to run the script using the code provided in the python document, but an error was reported.
Hi,
how to get position.x/y/z DescID of a vector
i use this script to find Position DescID,but can‘t direct get position.x/y/z DescID,only indirectly create a new DescID to access Position. x/y/z.
import c4d
def main() -> None:
description = op.GetDescription(c4d.DESCFLAGS_DESC_NONE)
for bc, paramid, groupid in description:
if paramid[0].dtype == c4d.DTYPE_VECTOR:
for id in range(1000,1003):
paramid = c4d.DescID(paramid[0],c4d.DescLevel(id))
if op.FindKeyframeSelection(paramid):
print(paramid,op[paramid])
if __name__ == '__main__':
main()
Although the above script achieved its goal, it was not the expected method. Did I overlook something? I don't want to use the method of creating a new DescID.
Thanks for any help!
Here is one of the calculations:
In world coordinates, get ab vector and the length of bc vector
Then normalize the ab vector , then use the length of the bc vector to scale the length of the has normalized ab vector , use point b world position to offset the ab vector (that is, add the world position of the point b vector) to get the position of point C
file use Xpresso to calculate C Position
test.c4d