Ah gotcha. Thanks for the heads up! :)
bentraje
@bentraje
Posts made by bentraje
-
RE: Global variable for Preferences Folder?
-
RE: Global variable for Preferences Folder?
@C4DS said in Global variable for Preferences Folder?:
GeGetPluginPath
Unfortunately, it returns me the following path
C:\\Program Files\\Maxon Cinema 4D R21\\corelibs'
.
No worries, I just did theos.path.join(path, "plugins")
and it works as expected. -
RE: Global variable for Preferences Folder?
Lol. Ignore this. Just when I was writing this, stumbled upon the documentation that solves my problem.
Here is the method.
c4d.storage.GeGetStartupWritePath()
-
Global variable for Preferences Folder?
Hi,
Is there a global variable for preferences folder where it automatically retrieves the path of the preferences?
Currently, I have it hard coded like in the following, but it would be nice a fail-safe of doing it (i.e. global variable).
def open_folder(path=r'C:\Users\Luke\AppData\Roaming\MAXON\Maxon Cinema 4D R21_64C2B3BD\plugins'): webbrowser.open('file:///' + path)
-
RE: Iterate over the View/Hotspots of Visual Selector Tag
RE: This is a limitation you also have with the visual selector
Not really. You can multiple select hotspots and/or controllers in the visual selector.
Anyhow, thanks for the response. I guess there is no way around this.
-
RE: Iterate over the View/Hotspots of Visual Selector Tag
Thanks for the response, especially for the visual selector being old, as currently I find it buggy.
I check the interaction tag example files here:
https://help.maxon.net/r21/us/index.html#TINTERACTIONThe main limitation I have found of it is I can only select one control at a time.
I can't drag and select controls like that of visual selector tag. Correct me if I'm wrong. -
Iterate over the View/Hotspots of Visual Selector Tag
Hi,
Is there a way to iterator over the view/hotspots of the visual selector tag?
According to this thread, it is not possible. But perhaps, there were updates?When you move the visual selector to another document, the link field will be lost. My use-case is to automate "inputting" the link field to every hotspots. Something like this:
for hotspot in hotposts: hotspot_name = hotspot.GetName() hotspot_obj = doc.SearchObject(hotspot_name) hotspot.SetLink(hotspot_obj)
Regards,
Ben -
RE: Connect C4D with Tkinter (External Application) ?
Thanks for the response and the website reference.
I was able to work the code with the following revisions:def CoreMessage(self, id, bc): if id == 1234: P1MSG_UN = bc.GetVoid(c4d.BFM_CORE_PAR1) pythonapi.PyCObject_AsVoidPtr.restype = c_int pythonapi.PyCObject_AsVoidPtr.argtypes = [py_object] P1MSG_EN = pythonapi.PyCObject_AsVoidPtr(P1MSG_UN) # check message and act if (P1MSG_EN == 1): c4d.documents.GetActiveDocument().InsertObject(c4d.BaseObject(c4d.Ocube)) elif (P1MSG_EN == 2): c4d.documents.GetActiveDocument().InsertObject(c4d.BaseObject(c4d.Osphere))
Thanks again. Will close this thread now.
-
RE: Connect C4D with Tkinter (External Application) ?
Hi @r_gigante
Thanks for the response. There is an value error. I tried to solve it but the
C
thing is still over my head :(
It's on lineP1MSG_EN1 = pythonapi.PyCapsule_GetPointer(P1MSG_UN1, None)
with the error ofValueError: PyCapsule_GetPointer called with invalid PyCapsule object
Just wondering, why do we need to convert the data into C then back into Python ?
-
RE: Connect C4D with Tkinter (External Application) ?
@r_gigante @zipit
Thanks for the response. Yea, I guess the connection was never made since the socket creation was made after
mainloop
I tried the
tkinter code
provided by @r_gigante.
It works, the problem is it only works once. So after clicking next buttons, primitives are not created.
You can see it here:
https://www.dropbox.com/s/m2mpk2ctjkizgfc/c4d308_python_socket02.mp4?dl=0I can see that the tkinter button works (i.e. prints out the "cube", "plane" etc on every click).
I guess the problem is the c4d plug-in receives it only once.
Is there a way to have theSpecialEventAdd()
andCoreMessage
run every time and not only once?