Plugin Cafe Homepage
Forum Home Forum Home > Plugin Cafe > SDK Help
  New Posts New Posts
  FAQ FAQ  Forum Search

Selecting spline segments

Author
Message
  Topic Search Topic Search
rsodre View Drop Down
Member
Member


Joined: 2014 Jun 15
Location: Brazil
Online Status: Offline
Posts: 91
Direct Link To This Post Topic: Selecting spline segments
    Posted: 2018 Jan 31 at 9:07am

User Information:

Cinema 4D Version:   R19 
Platform:   Windows  ; Mac  ;  Mac OSX  ; 
Language(s):     C++  ;   

---------

Hello.

I need to use the selection tools to select individual spline segments from an object.  About a decade ago someone needed something similar and there was no way back then.

Since it seems that I can't select edges of a spline, only points, I'm creating several splines, one for each selectable segment. Each spline is an object based on the Double Circle example, with GetContour().

But now this is getting too messy on complex objects, and I have to manage temporary splines created only to be selected. Is there a better way to do that?

Mabe a mesh without polygons, only edges and points, is it possible?
Back to Top
Andreas Block View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2014 Oct 01
Location: Hannover
Online Status: Offline
Posts: 1878
Direct Link To This Post Posted: 2018 Feb 01 at 5:22am
Hi,

Cinema 4D has no selection tool to select the segment of a spline. Also C4D has no real concept of edges, edges do get implicitly defined by the polygons of a polygon object. So a polygon object with just points and edges is not possible either.

I guess, what you could do is write your custom spline segment selection tool, which would select all points of a segment upon selection of one of its points. But on the other hand, I'm not sure, I fully understood what you are actually trying to achieve. In what way does the spline generator come into play here? Perhaps you can provide us with more details, maybe we can then come up with alternative solutions.

Cheers,
Andreas
SDK Support Engineer
Back to Top
rsodre View Drop Down
Member
Member


Joined: 2014 Jun 15
Location: Brazil
Online Status: Offline
Posts: 91
Direct Link To This Post Posted: 2018 Feb 06 at 6:07am
Hi Andreas,

Our plugin draws several procedural splines that we want to manipulate with transform tools. I would like to use the native move/rotate/scale tools, if possible.

I already achieved that creating an object with the individual splines (custom objects with GetContour)., each one listening to NOTIFY_EVENT_SELECTIONBIT, MSG_MOVE_START and MSG_MOVE_END. I show and hide them when I enable the user to transform.

It's working fine, I just would like to hide them in the Object Manager to avoid confusion and have full control of their state. I know it's doable but haven't tried yet.
Back to Top
rsodre View Drop Down
Member
Member


Joined: 2014 Jun 15
Location: Brazil
Online Status: Offline
Posts: 91
Direct Link To This Post Posted: 2018 Feb 20 at 7:12pm
I got it working fine, hiding my selectable splines in a new layer with manager off.

But I have a small problem.
I create the temporary selectable splines I when I select a specific tag, edit them, and when the tag is no longer active I can delete them.
Works fine for live selection, but when a rectangle, lasso or polygon selection ends, it automatically unselects any selected tag, deleting my splines before I can use them.
if I knew any selection tool is active AND actually selecting something I could avoid that, so is there any event for the start and end of a angle, lasso and polygon selection? Or to query if they are in use atm?
Back to Top
Andreas Block View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2014 Oct 01
Location: Hannover
Online Status: Offline
Posts: 1878
Direct Link To This Post Posted: 2018 Feb 22 at 2:06am
Hi,

no, the selection tools to not post any events, when they are actually selecting something.
But instead you could listen to EVMSG_TOOLCHANGED and then check with GetAction() (or GetActiveTool()), which tool is currently active.

Cheers,
Andreas
SDK Support Engineer
Back to Top
rsodre View Drop Down
Member
Member


Joined: 2014 Jun 15
Location: Brazil
Online Status: Offline
Posts: 91
Direct Link To This Post Posted: 2018 Feb 22 at 3:40pm
Maybe I can do that with a Scene Hook plugin?
Back to Top
Andreas Block View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2014 Oct 01
Location: Hannover
Online Status: Offline
Posts: 1878
Direct Link To This Post Posted: 2018 Feb 23 at 8:18am
I'm sorry, because I actually had planned to provide that information...
A simple MessageData plugin would do the trick already.

Cheers,
Andreas
SDK Support Engineer
Back to Top

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.61 [Free Express Edition]
Copyright ©2001-2009 Web Wiz

This page was generated in 0.094 seconds.