[Closed] $…* = everything in scene????
but of course in many cases it’s much batter to use index identifier (handle, anim handle, hash value, crc, ) than node itself. All operation as sort, search, unique are faster if you do it with numbers.
Probably because you are adding a pathname to an array. So you will need to loop through the getselectionshierarchyarray and each pathname. Try something like:
getselectionshierarchyarray = #()
if selection.count >= 1 do
(
for x = 1 to selection.count do
(
nm = selection[x].name
execute ("append getselectionshierarchyarray $"+nm+"...*")
)
--print getselectionshierarchyarray
for i in getselectionshierarchyarray do
(
for j in i do
(
print j.parent
)
)
)
Uncomment print getselectionshierarchyarray if you want see what is actually in the array before trying to print the info.
-Eric
Hey, I’ve been getting some errors using that every once in a while,
-- No ""append"" function for undefined <<
It’s wierd, it will work one minute then not work the next.
Any ideas whats going on here?
The Code:
getselectionshierarchyarray = #()
if selection.count >= 1 do
(
for x = 1 to selection.count do
(
nm = selection[x].name
execute ("append getselectionshierarchyarray $"+nm+"...*")
)
--print getselectionshierarchyarray
for i in getselectionshierarchyarray do
(
for j in i do
(
print j.parent
)
)
)
Edit: I might add, I have it in a function. Which is used when a button is pressed.
Acting as if I have nothing selected… or the name doesnt match $+name (the node)
It’s only doing this when I have it in the rollout a few times, like maybe the 2 are interfering with one another, they have different array names.
Oh?
Is there a way to give the execute a name or title or w.e to seperate it from another execute?
Sounds like you failed to define the array that is being called in the append execute code.
There is no way to identify an execute as all it does is run the supplied string as maxscript code. You could build print, other code, or comments into the execute string to identify it in the listener or modify the rollout.
-Eric