Creating ngons in a deformer?
On 06/11/2015 at 04:26, xxxxxxxx wrote:
Cinema 4D Version: R17
Platform: Mac ;
Language(s) : C++ ;
Greetings to all.
I need to write a plugin that can create n-gons on the fly, without actually altering the original mesh. I figured the best way to do this was to write an object deformer that can dynamically remove select edges to create the required n-gons, but I'm not really sure how to go about this.
I see the API has a nice function called GetNgonEdgesCompact() that returns a very simple structure of what edge is or isn't hidden. This seems to be exactly what I want, except GetNgonEdgesCompact() is read only and changes that I make to it are not reflected in the model.
Is there anything like this in the API?
I've been reading up on the Ngon/Pgon/Modelling library API, but that all seems awfully complex and I'm not really sure how to remove edges using those. I don't actually want to change the point count or order of the mesh (in fact, I'd rather go out of my way to ensure that never happens). All I'm after here is the ability to pick a few edges and dissolve them from the mesh in non-destructively.
On 06/11/2015 at 04:53, xxxxxxxx wrote:
I am not sure I fully understand the request but an object deformer should imo only be used to actually deform the mesh. If you want to create n-gons on the fly and present it to the user then you should use an object generator and simply create your mesh in GetVirtualObjects().
On 09/11/2015 at 04:57, xxxxxxxx wrote:
this is actually not quite true. For example the Explosion FX modifier adds geometry to the modified object.
Within ModifyObject() you can use the ResizeObject() functions to make room for additional geometry or to shrink the number of points/polygons. GetPointW() and GetPolygonW() let you alter the points and or polygons. And the Neighbor class might come in handy as well.
On 09/11/2015 at 05:07, xxxxxxxx wrote:
Oh ok. Thanks for clearing this up. I was never aware of that being allowed.
On 11/11/2015 at 18:41, xxxxxxxx wrote:
Is there any way to create ngons without using SendModelingCommand() or the modelling library?
I've ran into a fairly nasty issue with Pose Morph. Apparently changing the geometry (rather then just modifying the point positions) causes Pose Morph to freak out, and it gets stuck in an infinite loop that prevents the scene from being rendered at all (the viewport won't start rendering, and the picture viewer gets stuck on "Preparing..." forever).
This is no good since the plugin I'm writing is supposed to be the last deformer under a polygon object that is often affected by a Pose Morph tag.
All I need the plugin to do is to hide a few edges so that the Subdivision object can't see them. The general idea was that I could setup an edge selection tag, then point my deformer plugin at that, and have it remove those edges by combining the neighbouring polygons into an n-gon non-destructively.
Is it possible to do this somehow without causing Pose Morph to lock up in an infinite loop?
On 17/11/2015 at 09:51, xxxxxxxx wrote:
Ooopsy, I was pretty sure I wrote a post, but somehow I must have forgotten to post it... Sorry!
In order to answer your question, I guess you would need to post some code. But before doing so, can you please check your scenario (Pose Morph) with the ExplosionFX deformer. This definitely changes the poly count of the object and seems to work with PoseMorph, at least I wasn't able to lock up Cinema.