[Closed] select xref'd scene by parentnode
I was wondering if it’s possible to select the xrefs in the xrefs scene dialog based on the parentdummies they’re bound to.
example:
I have xref’d 5 scenes, they are all bound to a dummy to move them etc.
I now want to select 3 dummies then run a script to bring up the xref scene dialog with the corresponding xrefs selected.
any ideas ?
Hi Equinoxx,
Just had a random play with your idea. I dont know if it is possible to manipulate the selection in the XRef scene dialogue, and unfortunately I dont have time to look into it. So I wrote a little macro that if you run with any selection it will sort through the selection and report back the name of any binding objects, along with their XREF Names and the position that they will appear in the XRef Dialogue UI.
It simply prints this info out into the listener.
macroScript BindObjectInfo category:"XRef Games"
(
--Small Script to Flick through XRefs and Find Binding Box
local XCount = xrefs.getXRefFileCount()
local XBinds = getcurrentselection()
local XREFNames = #()
for i = 1 to XCount do
(
CurrXRef = xrefs.getXRefFile i
append XREFNames CurrXRef.filename
)
sort XREFNames
for i = 1 to XCount do
(
CurrXRef = xrefs.getXRefFile i
for o in XBinds do
(
if o == CurrXRef.parent do
(
Print ("BIND OBJECT : " + o.name + " XREF : " + CurrXRef.filename + " LIST POSITION : " + (FindItem XREFNames CurrXRef.filename) as string)
)
)
)
)--BindObjectInfo
I apologise if this is entirely useless, but if you can find the command to influence the selection in the XREF Dialog then all the info you will need is here to make that selection…
Hope it helps,
Rich
it helps me somewhat in understanding the relations.
I’m still trying to find out if there’s a way to access the xRef scene dialog with maxscript
in the meanwhile, I just modified your script to set the enabled status
for i = 1 to XCount do
(
CurrXRef = xrefs.getXRefFile i
append XREFNames CurrXRef.filename
)
sort XREFNames
for i = 1 to XCount do
(
CurrXRef = xrefs.getXRefFile i
for o in XBinds do
(
if o == CurrXRef.parent do
(
CurrXRef.disabled = not CurrXRef.disabled -- toggle
)
)
)
I’d still like to know is it’s somehow possible the way I first intended.
By having it bring up the xref scenes dialogue with the correct xrefs preselected.