Jump to content

C4DS

New plugin - PointLess

Recommended Posts

I am working on a new plugin, and would like to query for user interest.

 

Background info:
I am not an expert at modeling, but from time to time I create some objects for short stories I am making, or other projects I am working on.
For the past 2 years or so, I have spent most of my time writing some plugins. As such I didn't quite follow the progress of modeling tools (or lack thereof) in the recent Cinema 4D releases. Recently I was creating a mesh, representing a faceted low-poly gnome to be used as illustration for one of my plugins, when I noticed that removing polygons still left orphaned points behind. Same behaviour as always, from the early days I worked with Cinema, till the last time I modeled something before focusing on plugin writing, and then even today.


So, over the span of 10 Cinema 4D releases (R9 - R19), nothing seems to have changed regarding this behaviour.

Now, I can understand some of the reasoning behind the current behaviour.
Still, I wonder how many requests I have submitted to MAXON over the years, to provide an option to allow the user to decide if orphan points should, or should not be removed automatically when deleting polygons.
I don't know what R20 will bring, but I didn't want to wait any longer for MAXON to provide said option, and decided to write my own plugin to perform the task of removing these orphan points ... while providing an option to do so or keep the current behaviour (avoiding the need of removing the plugin when user wants to switch between these different behaviours).

 

The plugin:
It's a free R17-R19 plugin, currently Windows only, but will be made available for MacOS when time permits.
It might also become available for R16, but nothing promised at this time.
The plugin is document based, and simply runs in the background. No user interaction is required, as removal of orphan points is done automatically, whatever mode the user is working in.
Simply enable the plugin (scene configuration) ... and model away.

 

Naming request:
Since the project is still ongoing, I haven't decided for a final name yet.
The project is currently named AROP, short for Auto Remove Orphan Points.
But could as well end up being named URP (Unused Point Remover), or anything closely related.
If anyone comes up with a fancy name, just let me know.

 

Beta testing request:
As with all my plugins, it is closely based on the workflow I am familiar with.
While good enough for me, this might not be the case of more expert users, or even beginners for that matter.
As such, I'd like to ask for a few people's time to spend testing this plugin, before being officially released.

Contact me for details.

 

Most important feedback I am looking forward to:
- is the plugin slowing down the performance of Cinema 4D
- any lag related to the use of the plugin on small or large objects
- are there any orphan points still left untouched by the plugin
- what's the total user experience using this plugin

 

Thanks for reading
Daniel

 

 

  • Like 2

Share this post


Link to post
Share on other sites

Oh, please call it 'Kill the Orphans' ;) lols.

Maybe 'Points be Gone!' is less controversial...

 

In some ways I quite like that it just runs in the background, doing it, and that should certainly remain one 'mode' of it.  But I think I would appreciate some alternative functionality where it was turned off all the time, but when I make a poly selection and hit say, shift + delete that could remove the polys AND points, whereas delete alone wouldn't, thereby preserving the choice to kill the points or not on an action-by-action basis, without having to dive into project settings first... it's a small point, but thought I'd suggest it anyway... although I am one of the few people on earth who sometimes uses remaining points to plot different topology, even I have to admit I want the points gone about 90% of the time...

 

Lastly, thanks for continuing to make and share these sorts of plugins - very helpful stuff.

 

CBR 

 

  • Like 1

Share this post


Link to post
Share on other sites
16 minutes ago, Cerbera said:

Oh, please call it 'Kill the Orphans' ;) lols.

 

Well, the very first name I used when setting up the research for this project was "Auto Orphan Killer". It's just a name, I thought at that point. And while it might sound funny in a way, I don't think many would have appreciated it. Another plugin of mine (PolyGnome) was originally meant to contain "enjoliver" in its name (french for embellish-er). Guess I better not call this new plugin "enjoliver twist" then.

 

29 minutes ago, Cerbera said:

... But I think I would appreciate some alternative functionality where it was turned off all the time, but when I make a poly selection and hit say, shift + delete that could remove the polys AND points ... thereby preserving the choice to kill the points or not on an action-by-action basis

 

Nice idea, I didn't think about that.

However, deleting is handled by Cinema itself, then the plugin does some post-processing. As such it does not detect the "delete" nor "shift-delete".

Currently when you use "shift+delete" nothing happens, as Cinema does not know what that shortcut actually means.

Had a quick look in "customize commands" and apparently the delete key (when meant to delete the current selected polygons, edges, points) is assigned ID 12109.

 

For the "shift+delete" to work the way you mentioned you could assign it to some script, which does a delete + clean up.

Which is probably easier to create than this whole plugin I made ... Again, didn't think of that.

 

42 minutes ago, Cerbera said:

Lastly, thanks for continuing to make and share these sorts of plugins - very helpful stuff.

 

My pleasure.

 

 

  • Like 1

Share this post


Link to post
Share on other sites

Copy following code into the Script Manager window and save it as i.e "Delete+Cleanup"

 

Then with "Customize Commands", filter on the entered file name, and assign it "Shift+Delete" as shortcut keys ... and Bob's your uncle.

Makes this whole AROP plugin I made completely obsolete ;-)

Just why I didn't think of that before starting this whole plugin.

 

import c4d

def main():

    # perform the delete (ID=12109)
    c4d.CallCommand(12109)
    
    # perform the clean up
    # get the currently active polygon objects
    objects = list()
    activeObjects = doc.GetActiveObjects(c4d.GETACTIVEOBJECTFLAGS_CHILDREN)
    for obj in activeObjects:
        if obj.IsInstanceOf(c4d.Opolygon):
            objects.append(obj)
            
    # remove unused points
    settings = c4d.BaseContainer()
    settings[c4d.MDATA_OPTIMIZE_UNUSEDPOINTS] = True
    res = c4d.utils.SendModelingCommand(command = c4d.MCOMMAND_OPTIMIZE,
        list = objects,
        mode = c4d.MODELINGCOMMANDMODE_ALL,
        bc = settings,
        doc = doc)

    c4d.EventAdd()

if __name__=='__main__':
    main()

 

Edit:

Had some typos in the code, fixed now.

  • Like 1
  • Namaste 1

Share this post


Link to post
Share on other sites
43 minutes ago, C4DS said:

Had some typos in the code, fixed now.

Awesome. So sorry it made the plugin redundant, although I'm not sure it did - there will be a lot of people who want it on all the time and you could easily pop both options in the zip ;) But I for one am exceptionally grateful for that bit of scriptings so cheers ! :)

 

CBR

  • Like 1

Share this post


Link to post
Share on other sites

This is great!  Thanks @C4DS!

 

Edit:

Didn't realize there's no link to download.  I'd be interested to Beta test for you if you'll send me the file!

Edited by natevplas
  • Like 1

Share this post


Link to post
Share on other sites

While I still believe the current plugin to be obsolete, I agreed to let user @natevplas beta test it.

If only to test the provided mechanism does work without introducing any lag or delayed user response. This mechanism could then, potentially,  be used in future for other purposes

 

Why I believe the plugin to be obsolete?

Well, it is only a matter of creating appropriate short cut keys in order to provide the current behaviour (keep unused points), or the custom behaviour (auto remove points). Currently, the backspace and delete keys are assigned to the current behaviour. But people can simply assign a different short cut key to the current behaviour and assign the backspace and delete key to the above script.

This way, it's up to the user to define the default and custom behaviour ... without the need of a plugin (which will probably not work in future releases anyway).

 

 

Share this post


Link to post
Share on other sites

It has been decided to put the plugin on an early retirement scheme ...

 

The alternative solution using a script and short-cut key(s) is a much more user-friendly approach, which I actually prefer over a plugin.

And it's platform independent, as well as release independent (unless the R20 SDK does break it).

 

But all effort to make the original plugin is not gone to waste.

Firstly, I learned a few things while implementation this "sneaky background" action. Secondly, it resulted in a much easier to maintain scripted solution.

 

I will probably provide some update to the script, as I figured out a few extras. But I am currently too busy, so that will have to wait for a while.

  • Like 1

Share this post


Link to post
Share on other sites

Well it was a good idea. Since it's redundant, so is this by the way, I thought up a name for the plugin. Point Less. :lol: I'm laughing at my own jokes now. I can feel you all grimacing.

  • Like 1
  • Haha 2

If in doubt, scream and shout.

 

Share this post


Link to post
Share on other sites
27 minutes ago, JLeaburn said:

Well it was a good idea. Since it's redundant, so is this by the way, I thought up a name for the plugin. Point Less. :lol: I'm laughing at my own jokes now. I can feel you all grimacing.

Maybe it's the dad in me, but I laughed too!  Perfect name for it!  You can at least name the script "Point Less" when you save it.

Share this post


Link to post
Share on other sites

Well, who would have thought.

It is a funny coincidence that R20 does have this feature. We've been years without this ability and now suddenly solutions pop up in my mind as well as in MAXON's developers ones. There must be something in the air ... or we must have been smoking the same stuff. Oh right, I don't smoke.

 

I don't know if this feature was already available in R20 betas, way before I dreamed up the solution.

But I want to believe that MAXON's developers were inspired by this thread, and implemented their take on it. That way, the whole orphan point project at least wasn't "pointless".

Still am jealous of @JLeaburn coming up with this terrific plugin name ... ROFLMOPO. My hat off to you, sir.

  • Like 1
  • Haha 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

YOUTUBE CHANNEL:

ABOUT US:

C4D Cafe is the largest CINEMA 4D community. We provide facilities for discussion, showcasing and learning our favorite software :) Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, get your own private messenger, post status updates, manage your profile and much more. If you need to find solution to your problem or otherwise ask for help, Cafe is the right place.
×
×
  • Create New...