On 31/08/2018 at 07:42, xxxxxxxx wrote:
I can't seem to figure out how to get
I would like to save some info to an Annotation tag, but only right before the user saves the document.
Tried to put it in Message() but couldn't figure out if Message can stand by itself or if it has to be in a NodeData class?
class SampleClass(plugins.NodeData) :
def Message(self, node, type, data) :
if type == c4d.MSG_DOCUMENTINFO:
if data['type'] == c4d.MSG_DOCUMENTINFO_TYPE_SAVE_BEFORE:
print "Document is about to save"
On 31/08/2018 at 05:31, xxxxxxxx wrote:
I'm afraid, as mentioned here there is no direct way to use our internal command for select outline.
You get a basic implementation of the comment from Donovan by Cesar Vonc [URL=https://code.vonc.fr/?a=100#f-SelectionneAretesContour] which might help you.
If you have any question please let me know.
On 30/08/2018 at 13:12, xxxxxxxx wrote:
How can I select the outline edges of selected polygons in python, just like the command "Outline Selection"?
On 31/08/2018 at 04:07, xxxxxxxx wrote:
Hi Myosis, first of all, welcome in the plugincafe community!
Even if shader didn't get a proper symbols name, each BaseList2D get an ID. And symbols only refer to this ID.
So if you want to know the current ID of an Art shader. Simply create a shader in a material, then drag and drop the channel where the shader is into the console. Press enter and it will print you the ID.
For the art shader, it's 1012161.
About bitmap do the same technique, simply drag and drop the parameter into the console to know the parameter ID.
Then you can create it using the following script
def main() :
mat = doc.GetActiveMaterial()
if not mat:
# Create the bitmap shader
bmpShader = c4d.BaseShader(c4d.Xbitmap)
bmpShader[c4d.BITMAPSHADER_FILENAME] = "YourTexturePath"
# Create a art Shader and insert our bmp shader
artShader = c4d.BaseShader(1012161)
artShader[c4d.ARTSHADER_TEXTURE] = bmpShader
# Then insert our art Shader into the active material, and use it in the color channel
mat[c4d.MATERIAL_COLOR_SHADER] = artShader
As you already figured out, in python the only way to load stuff from content browser is to use LoadFile/MergeDocument.
If you have any question, please let me know!
On 30/08/2018 at 23:11, xxxxxxxx wrote:
I figured out how to load the material form the content browser:
> doc = c4d.documents.GetActiveDocument()
> location = "preset://somefolder.lib4d/mymat"
> c4d.documents.MergeDocument(doc, location, c4d.SCENEFILTER_MATERIALS)
But I prefer creating the material in python rather then loading it, if anyone knows how to access and apply the Art shader, let me know ;)
On 30/08/2018 at 02:01, xxxxxxxx wrote:
First off I'm new here, and also very new with python.
I'm trying to create a pretty basic material using python, but it seems not so easy.
I have two questions:
How can I add the Art shader to a channel?
It's not listed in the SDK shader list.
So it's probably not like I'm just missing the right word here, is it ?
> matt[c4d.MATERIAL_USE_LUMINANCE] = True
> Art = c4d.BaseList2D(c4d.X...something.....)
> matt.InsertShader( Art )
> matt[c4d.MATERIAL_LUMINANCE_SHADER] = Art
I also want it to load a image in the art shader, so I figured, why don't I just create a preset folder in the content browser and load the material form that folder.
Turns out it's quite tricky to import materials from the content browser too.
> fn = "preset://somefolder/Cube.2.c4d"
If I use anything else then LoadFile, it will tell me to use a base document in the console.
From my understanding, I have to make a virtual base document and then import it from that.
How does that look like in code ?
I only need one to work, but I am very interested in both!
On 30/08/2018 at 10:47, xxxxxxxx wrote:
as Sebastian already pointed out last time, this is a forum for 3rd party developers. We can not help you with bugs not related to the SDKs here. Please contact our user support via the form on our main website: How can we help?
On 29/08/2018 at 13:58, xxxxxxxx wrote:
Cinema 4D Version: 19
Platform: Windows ;
Language(s) : PYTHON ;
Still Cinema have a GREAT BUG of simple selection
video of a bug
On 30/08/2018 at 11:15, xxxxxxxx wrote:
if I understand correctly, you want the entire Color Picker dialog, not just the color picker "action" you get, when clicking onto the pipette icon in color chooser, right?
The color picker dialog can be opened with GeChooseColor(). The color pick action on the other hand is implemented internally and can not be started via the API.
On 29/08/2018 at 05:26, xxxxxxxx wrote:
Cinema 4D Version: R18
Platform: Windows ;
Language(s) : C++ ;
I have my custom GeUserArea in a CustomGui parameter.
I want to click that User Area and launch the Color Picker modal dialog as happens with ColorField dialog parameter or COLOR description parameter.
Can I do that ?
On 29/08/2018 at 13:29, xxxxxxxx wrote:
Of course. Thanks Riccardo!
On 29/08/2018 at 02:53, xxxxxxxx wrote:
Hi Rasha, the Connect Object functionality is delivered by the MCOMMAND_JOIN.
On 29/08/2018 at 02:21, xxxxxxxx wrote:
I did not see the "Connect Object" modeling commands represented in MCOMMAND (https://developers.maxon.net/docs/Cinema4DPythonSDK/html/consts/MCOMMAND.html)
Is it available somewhere that I missed?
On 29/08/2018 at 02:18, xxxxxxxx wrote:
Hi RashaMatt, thanks for writing us.
With regard to your support request there are two options either viable.
The first is to take advantage of the modelling commands delivered in Cinema 4D by using the c4d.utils.SendModelingCommand() and use the appropriate command to achieve the desired behavior.
The second option is to hard code the merging operation directly in the generator by accessing the information about mesh points position and mesh polygons index for each entity you want to get merged, then by merging this data in a single mesh and finally by disposing the original meshes (if really needed).
On 28/08/2018 at 23:16, xxxxxxxx wrote:
Is there a way to do the equivalent of "Connect Objects" (or "Connect and Delete") in a Python Generator?
I am creating a hierarchy of groups of groups of polys, and the viewport is very slow. Perhaps it would be faster if I could convert it to a single poly object and optimize it?
On 31/08/2018 at 00:22, xxxxxxxx wrote:
Your workaround with a popup dialog sounds too hacky to me.
The command can be registered with c4d.PLUGINFLAG_HIDEPLUGINMENU flag (plugin won't be shown in "Plugins" menu).
Then manually add the command to any other menu/command palette with "Customize Commands" and "Customize Menu". The menu structure returned by the command's GetSubContainer() should be dynamically added as expected.
Note it is possible to customize the Cinema menu by code from a plugin.
If you have questions related to another subject, please create a new thread.
On 30/08/2018 at 14:58, xxxxxxxx wrote:
a followup question to the post above:
ShowPopupDialog() has these flags
what are these for?
i was hoping that you get a drag off handle,
but i cant see anything happen if i use these flags
is there a way to make a PopupDialog sticky?
or can i create a palette containing my command?
On 30/08/2018 at 03:36, xxxxxxxx wrote:
i actually had that idea this morning, but couldnt make it work
i added a 2nd pyp to the plugin with c4d.PLUGINFLAG_HIDEPLUGINMENU
but the main pyp didnt show its submenu then
are you sure this works?
(maybe i dont understand correctly)
it also needs a bogus plugin id, which is a bit odd, right?
another approach i'm trying is:
generate a PopupDialog and show it with ShowPopupDialog when the menu is selected (works already)
but i would also like to be able to have a drag off window with the (main) menu items as buttons
that could be generated by opt-selecting the menu (any tips on how to create such a window?)
On 30/08/2018 at 03:03, xxxxxxxx wrote:
Sorry for the late answer.
There are limitations with GetSubContainer() and the "Plugins" menu.
If there is only one plugin registered then its menu structure returned by GetSubContainer() is not taken into account. But if the plugin is added to another menu then it is shown as expected.
So the solution is to register a CommandData plugin with c4d.PLUGINFLAG_HIDEPLUGINMENU flag. Then the plugin can be added to any other menu either manually or with code using the menu functions in c4d.gui module.
On 30/08/2018 at 01:17, xxxxxxxx wrote:
no help here?
i tried for hours, but still cant create a plugin
with a sub menu to execute different actions