[Closed] Tagging System in 3dsMax
Hey guys, I’ve been thinking about this for the last weeks and I just can’t figure out how to do it:
Is there a way in 3ds max to “tag” nodes to organize things?
We have a layer manager, great, but you can only have one layer per object and we have named selection sets, also great, almost exactly what I would want, but they lack some utility and they’re only stored with the scene, as soon as you merge objects all organization is gone (so that’s not possible for production where you merge a lot between scenes)
And groups … yeah … just no.
So, I thought maybe I could try to do it myself. But either I’m blind or there is just no easy way to “tag” a node in max and use this tag to do all sorts of things with it (hide, unhide, select, deselect from selection, etc. – just to name the very basics)
I almost had a good run with user defined properties, but I don’t know how to get them into an array, so I can select more than one tag at once in a list for example.
So far I have this:
try(destroyDialog ro_TestTag) catch()
rollout ro_TestTag "TestTag"
(
-- INTERFACE
local tagname = if tagname == undefined then "" else tagname
group "Name Tag: " (
edittext txtinput text:tagname rewidth:40
)
group "Use Tag: " (
button bnSet "Set Tag"
button bnSel "Select Tag"
)
group "Hide/Unhide Tag: " (
button bnHide "Hide Tag"
button bnUnhide "Unhide Tag"
)
group "Clear Tag: " (
button bnSelClear "Clear Tag (Sel)"
button bnClear "Clear Tag (Scene)"
)
-- FUNCTIONS (copied from denisT, function to delete user defined props)
fn deleteUserProp node prop = if getUserProp node prop != undefined do
(
buff = (getUserPropBuffer node) as stringStream
newb = stringStream ""
while not eof buff do
(
str = readLine buff
if str != "" and not matchpattern str pattern:("*" + prop + "*=*") do format "%
" str to:newb
)
setUserPropBuffer node (replace_LF_with_CRLF (newb as string))
)
-- BUTTONS
on bnSet pressed do
(
for o in selection do
(
setUserProp o txtinput.text true
)
)
on bnSel pressed do
(
select (for o in objects where getUserProp o txtinput.text == true collect o)
)
on bnClear pressed do
(
for o in objects where getUserProp o txtinput.text != undefined do
(
deleteUserProp o txtinput.text
)
)
on bnSelClear pressed do
(
for o in selection where getUserProp o txtinput.text != undefined do
(
deleteUserProp o txtinput.text
)
)
on bnHide pressed do
(
for o in objects where getUserProp o txtinput.text == true do hide o
)
on bnUnhide pressed do
(
for o in objects where getUserProp o txtinput.text == true do unhide o
)
) -- End of rollout
createDialog ro_TestTag width: 120 style:#(#style_SysMenu, #style_ToolWindow)
Well, I hope someone with more experience could hint me into the right direction, I don’t know if this attempt is even a good idea or if I have to use something else (custom attributes maybe?)
Or there is already some script or plugin that does exactly that and I just can’t find it?
Any help is much appreciated!
Stan
When you need to link data to an object, I would say that Custom Attributes are definitely the way to go.
I think you will find very valuable stuf in the “Outliner” tool sources from Pjansen.
the three ways that I use to tag nodes with custom data are:
- Attributes
- User Properties
- Appdata
They all have pros and cons, User Properties are quick and easy but not super robust as anyone can access them (you may want to hide this data from the user for example)
Appdata is fast but doesn’t persist with the node if it is cloned.
because most of my recent tools and pipelines are related to animation and rigging there is my tagging techniques in favour order:
#1 Naming Convention
#2 Selection Sets
#3 Layers
#4 AppData
#5 CustAttributes
#6 User-Defined Properties (didn’t use it for many years)
So if I need a stable tagging system that doesn’t break when I copy objects or merge them into a new scene my only options are custom attributes?
you can add a node event call back that can handle the cloning issue with Appdata.