Link input data field in a custom dialog ?

On 26/07/2016 at 18:26, xxxxxxxx wrote:

Userdata has this kind of data field, this datafield supports:

  • Objects
  • Materials
  • ....

Link data field

It's easily recognizable since it has the arrow for selection.

I think it should be possible since I saw this used in the Magic Replace plugin from NitroMan which is a Python plugin.

Magic Replace

So I wonder If I can create this for a script that creates a custom dialog, I gave a look under :
[ **c4d.gui.GeDialog**](https://developers.maxon.net/docs/Cinema4DPythonSDK/html/modules/c4d.gui/GeDialog/index.html#) ** ** in the SDK but I couldn't find such type of field, that looks very useful since it supports drag and drop too.

On 27/07/2016 at 05:41, xxxxxxxx wrote:

Hi Mayorc,

welcome to the Plugin Café forums 🙂

The GUI element you are looking for is called LinkBoxGui. It's added via AddCustomGui().

But please be careful, you can only do synchronous/modal dialogs within a Script Manager script. So drag and drop for example won't be possible. If you need asynchronous/non-modal dialogs you will be better of with your own CommandData plugin (which really isn't that much different from or any more complex than a script).

On 27/07/2016 at 08:59, xxxxxxxx wrote:

And the plugin examples are really helpful if you haven't made one before, since it is a lot to take in at once (at least for me).

On 27/07/2016 at 09:30, xxxxxxxx wrote:

So it must be compiled to get drag and drop, I wonder now if the Arrow (instead of d&d) would work though, but still think that in a modal window it could not work.

Yeah I agree is alot all at once, I've already studied many of the script examples, I will sooner or later get a look on those plugins. 🙂

On 27/07/2016 at 09:36, xxxxxxxx wrote:

No, it must not be compiled to get drag and drop. But it needs to run in a context that allows for non-modal dialogs.
Just take a look at the example plugins (in your case especially CommandData ones) Withers posted. It's really not a big deal to convert your script into a CommandData plugin, don't be scared.