Tools with a twist
On 14/04/2017 at 04:23, xxxxxxxx wrote:
Cinema 4D Version: R18
Platform: Windows ;
Language(s) : C++ ;
First of all, the following is only an idea. I am still gathering information for a potential plugin, so far I have not a single line of code.
Assume the plugin is a CommandData plugin with dialog and a UserArea. This user area will display items that the user can select and move/size. These actions could be supported by the native tools (live selection, rectangle selection, move and scale tools). Of course the implementation will need to be mine for performing hit testing and executing the actual moving and scaling. But I could re-use the existing tools, by detecting the returned value of GetAction(). Benefit from doing so would be to be able to use the attributes from the native tools.
Additionally I would also like to provide non-native tools. I guess some of these might need one or two attributes. So, should I create a (Description)ToolData plugin for each of these tools, or is there some sort of alternative? As the tool will only be available for the specific user area, it's kind of overkill to create a complete ToolData, only to:
- be able to provide one or two settings in an attribute manager
- be able to know which tool is active by calling doc->GetAction()
- allow user to customize palettes with these non-native tool icons
Alternative solution would be to provide gadgets in the dialog next to the user area (or separate dialog) to select the different tools, and provide some gadgets for settings. Much simpler to implement probably. But kind of ruins the integration in Cinema, as this means the plugin has its own attribute manager and tool palette.
Just wondering what my options are.
On 18/04/2017 at 02:30, xxxxxxxx wrote:
you post is somewhat confusing. I think you are trying to do the following: you want the user to select a build-in or custom ToolData based tool. The user should be able to configure that tool in the Attribute Manager. Depending on the select tool and its settings you provide different user interaction in a custom user area. Is that correct?
Off my head I wouldn't know any dialog or user area that behaves differently based on the currently active tool. So I don't think anyone is expecting that one has to select a tool to define how to work with a given user area. ToolData based tools are used to interact with the currently active BaseDocument displayed in a viewport window and have nothing to do with user areas. So if you have different modes of interaction in your GeDialog the best way may be to present these different modes within that dialog. There are no "tools" for user areas. So the question is why do you would like to have the selection of the active tool in one place, the configuration of the tool in another place (Attribute Manager) and the rest of the interaction in your GeDialog.
On 22/04/2017 at 00:01, xxxxxxxx wrote:
I am sorry if my message was confusing, I didn't find a better way to explain. I will try te rephrase things, hoping it does not add to the confusion.
The UserArea I had in mind would just be a different view on the scene. Another viewport, so to say. I would be using the standard viewport hotkeys to navigate (zoom, pan, rotate), and also allow the user to use the move/rotate/scale tool shortcuts to select said tools.
The bonus of doing so, would be to re-use the native attribute manager, and the shortcuts the user is familiar with.
The part of your answer regarding "selection of the active tool in one place, configuration of tool in anther place and interaction in GeDialog" I do not understand.
Considering the userarea being another viewport, what is then so different to the current way Cinema 4D works with the 3D viewports. You select a tool in the toolbar, configure the tool in the attribute manager, and interact in the 3D viewport.
Now substitute 3D viewport with my GeDialog userarea "viewport" ... would it not feel more natural to provide the same workflow?
Or are userarea based plugins not meant to interact with the basedocument?
My other plugin, Seamilar, could very much benefit for using a same approach of re-using native tools. Which it actually sort of does.
Which reminds me that the Bodypaint TextureView does re-use the move/rotate/scale tool, as well as selection tools. But does have different attribute manager settings than those tools when in non UV mode. So, natively there are already different interactions for same tools depending the kind of viewport.
I agree there are no tools for userareas. So, what are my options to let my userarea mimic a viewport? And let the user re-use familiar shortcuts, attributes, and tools?
Thanks in advance,
On 24/04/2017 at 00:18, xxxxxxxx wrote:
GeUserArea is the base class for a custom GUI element. So of course you can edit the currently active BaseDocument from user-interaction with a custom user area. But this has nothing to do with ToolData based tools.
ToolData plugins operate on the active document through the (active) viewport window. This viewport window is represented by the BaseView class that has nothing to do with user areas.
The only way I see to reproduce default viewport behavior in a custom user area is to re-write the desired functionality in your user area / dialog.
On 24/04/2017 at 23:54, xxxxxxxx wrote:
I am not sure I made myself clear in my second attempt of explaining the concept.
Rewriting the desired functionality in my user area to mimic the viewport behaviour, I understand that part, I also mentioned that in my original post.
Actually, I do understand everything you mention.
But since we're seemingly running in circles here, and as I am unable to better explain I suggest to end this discussion.
Thanks for your time.