Announcement

Collapse
No announcement yet.

Maxscript help needed

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Maxscript help needed

    Hi all

    I want to remove any all XREF objects in the scene, then remove the files it is referenced from the current scene. (Because the dialog is not working and I have couple thousand xrefed obects that doesnt exist from 10 files that also doesnt exist)
    Kind Regards,
    Morne

  • #2
    I found this:

    Code:
    local currentXRefScenesIndexArr = #[COLOR=#66cc66]([/COLOR][COLOR=#66cc66])
    [/COLOR][COLOR=#b1b100]for[/COLOR] i = xrefs.getXRefFileCount[COLOR=#66cc66]([/COLOR][COLOR=#66cc66])[/COLOR] to 1 by -1 [COLOR=#b1b100]do
    [/COLOR][COLOR=#66cc66](
    [/COLOR] append currentXRefScenesIndexArr [COLOR=#66cc66]([/COLOR]xrefs.getXRefFile i[COLOR=#66cc66])[/COLOR].filename
    delete [COLOR=#66cc66]([/COLOR]xrefs.getXRefFile i[COLOR=#66cc66])
    [/COLOR][COLOR=#66cc66])[/COLOR]
    But that's for XREF scenes.
    I'm having a hard time using this

    Code:
    [I]objXRefs.getAllXRefObjects()[/I]
    to modify the code and get rid of all xref objects.

    Anybody care to lend a hand please?
    Last edited by Morne; 26-01-2016, 06:37 AM.
    Kind Regards,
    Morne

    Comment


    • #3
      For those interested, this did the trick:
      Code:
      delete (for obj in objects where isKindOf obj XRefObject collect obj)
      Thanks to SwordSlayer on CGTalk for that one!
      Kind Regards,
      Morne

      Comment

      Working...
      X