On 23/01/2018 at 14:05, xxxxxxxx wrote:
Hi Frank, thanks for writing us and above all sorry for coming late here.
With regard to your question the methods pointed out in the post you're referring to, are actually only paving the first part of the road to get the external (outer) edges of a n-gon.
A short recap, for those not familiar with n-gons, on the terminology i'm going to use down below:
- n-gon: a face made of more than 4 edges and made up of at least two polygons sharing an internal edge (like the object on the left made up of poly 0,1,2,3,4,5);
- polygon: a face made of 3 or 4 edges (like poly 6 and 7 on the object on the right);
- face: a polygon or a n-gon;
- external edge: an edge which define the outer or inner boundary of a face and represented when Wireframe Display mode is active (all green numbers marked with a orange circle);
- internal edge: an edge which is shared across the polygons building up a n-gon (all the remaining green numbers)
- vertex/point: the start or end point of an edge (marked in red numbers).
It's also worthy to note that only n-gon can contain holes and can be concave (tracing a generic segment in the ngon might end in intersecting the ngon external outer/inner edges multple time) whilst a simple polygon cannot have holes and can be only convex (tracing a generic segment in the polygon will never end in intersecting the polygon external outer edges). For the sake of completeness, PolygonObjects which are made of multiple polygons or ngons can instead create holes and be concave as well.
My solution to find the outer edge is conceptually simple:
The PolygonObject.GetNgonEdgesCompact() is helpful to mark which edges are internal or external in a PolygonObject made by just one n-gon.
At the same time Neighbor.GetNeighbor() is helpful to distinguish those external edges which are mutually used by a polygon and a n-gon (or two n-gons or two polygons) from those actually representing the real "external" boundary or a PolygonObject (like those in purple in the image above).
So far i don't think that either PolygonObject.GetPolygonTranslationMap() or PolygonObject.GetNGonTranslationMap() are needed, but maybe approaching the problem from a different perspective could be helpful as well.
Hope these few lines could help.
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 ?