Notifications
Clear all

[Closed] Drag and drop not working with texmaps/mtl buttons

I’m working on a renderer plugin for Max and have a number of plugin materials that all have this same problem.

For materials built in to Max, using the compact material editor, you can drag and drop already assigned texmaps to copy/instance them to other texmap slots. For example in this image, dragging along the red arrow would duplicate the color texmap into the subsurface color texmap slot. Doing this brings up a dialog asking if the user would like to copy or instance the texmap.

With the materials I have created for my plugin, this doesn’t work. Dragging and dropping one texmap button onto another just doesn’t do anything. For my GUIs, I am using a paramblock2 with P_AUTO_UI and the ui elements that aren’t behaving how I expect are TYPE_TEXMAPBUTTON. Clicking on the buttons still works and they correctly show what texmap is attached to the material, it is only the drag and drop that is broken.

Has anyone seen this happen before? I’m not sure if I’ve set up the paramblock auto ui incorrectly or if this is just something it doesn’t support.

4 Replies

I know nothing about the SDK, but from trying to figure it out for a maxscript tool I found these related SDK entries while trying to find a solution.
TexDADMgr
MtlDADMgr

Hope that helps,
-Eric

1 Reply
(@jlwitthuhn)
Joined: 10 months ago

Posts: 0

Not sure how I would fit there in, but I’ll take a look in the SDK for some sample use of these, thanks.

Nope, it does not assign the map at all. SetSubtexmap is never called and no message is sent to NotifyRefChanged. As far as I can tell none of the material’s methods are being called after the drag and drop.

Poking around a bit more I did notice that I can drag texmaps from my materials to other spots in the ui like the environment map slot and that works. Dragging from places like that to my materials does not work.

when you drag/drop a map, does it use then this map ?
maybe just the button doesn’t update to show an “M” ?

Just figured it out. The problem was that I wasn’t declaring a p_subtexno for each texmap inside my ParamBlockDesc2. Adding this in for each texmap fixes it.