[Closed] dotnet Tag properties
Hi guys,
I make extensive use of the Tag property on an listview items and subitems, storing materials nodes arrays etc. But every now and then max just crashes or hangs. I have it most when I have materials in a Tag (via dotNetMXSValue) and I want to assign the material from the Tag value to a medit slot. Loads of crashes. Can someone confirm such behaviour or have seen it before. I’m thinking about storing my materials etc, in seperate arrays and just store integers in the Tags to point to the location of the arrays.
If anyone has seen this behaviour or knows that it’s a limitation indeed, I’d be happy to know!
Thanks,
-Johan
I don’t think that the using of tag property to store materials can cause MAX crash. It can be anything else. Do you use any material callbacks or when construct?
No, nothing of that kind. But I tested it on another computer (XP64) and it crashes too (I’m on win7).
I’ll see if I can strip the offending part… but it basicly takes all scene materials puts that in tags of listview items and array of objects in subItems and from there when I click an item it assigns it too the mat edit slot, or to other objects etc. And the crashes are not always at the same point, sometimes the 1st time I do an action sometimes the 10th time. Really random.
I think I’m stripping it out for now,
thanks,
-Johan
P.s I think I have to point out that the storing is not a problem, no crashes there, but when I want to assign that material to another node or medit slot it can suddenly make max crash, as if dotnet crashes and takes max with it.
I’ve used the tag property for materials in listviews and I’ve not had it crash on assigning it to the material editor, at least not because of the tag property.
on MouseDown I have a function that gets the selected listViewSubItem, and it calls a popup menu where I have items that call another function to set the medit item. The popup menu’s are created by strings and executed, and they query the listview for it’s selectedItem property. Maybe it’s the mix of all these different things, popup menu in combination with dotnet control? Maybe it’s better to use a dotnet contextMenu strip?
-Johan
I think it’s just something wrong with your code. There is nothing in combination of mxs and dotnet that can crash MAX in your case. Try to isolate the problem. Post a snippet. And we will try to help you to find the bug. But I’m absolutely sure that after the isolation you will easy fix it yourself.
Yeah I’d say a contex menu would be better. You can always enable/dissable items in the menu based on what you’ve clicked or even add/remove items.
dotNet.addEventHandler myContextMenu “Opening”
you can enable/disable RCmenu items as well as filter (add/remove) them. I use both mxs RCmenus and dotnet ContextMenus. But I prefer the mxs RCmenu because it’s smaller (row height is smaller).
Could it be a memory issue? I have stuffed huge amounts of data into tab properties in the past without problems, I haven’t tried materials as far as I remember how ever.
that can’t be a memory issue. DotnetMXSValue is an objects that handles just a pointer to some data.
Nothing, it just hangs max, without coming back, or it crashes to the desktop. I’m crunching right now, I’m now storing a string in the tag pointing to an array where the mat value is stored. I will make a stripped down version. But there’s not much that can go wrong really… it’s a basic listview. And we just found that the 32bit version of max doesn’t crash on the tool. XP64.
When crunch time is over I’m going to completely rewrite the tool…
-Johan