Announcement

Collapse
No announcement yet.

Another MaxScript Question

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

  • Another MaxScript Question

    I'm trying to organize and clean up a file with 14k objects all called polyfacemesh*, but I have been so lucky as to have some layers and wire colours retained.

    I thought I'd make a tool that let me select a source object, and then it would select all objects in the scene with the same wire colour. This proved to be tricky to read up on in the maxscript help file.

    Can anyone help me with how to store a selected objects wirecolour and then select the other objects sharing the same colour?

    I also tried getting this to work through the visual maxscript editor, but that did not make it any easier

    Obviously I haven't the foggiest idea of what I'm doing:

    Code:
    source = selection
    
    getCurrentSelection()
    for obj in geometry do
    	(
    		if iskindof obj geometry do
    		--obj.wireColor = source.wireColor??
    	
    		
    		if obj.wireColor = source.wireColor
    			(
    				selectmore obj
    			)
    	)
    Signing out,
    Christian

  • #2
    no need to script it, it's already there:
    edit -> select by -> color
    Marc Lorenz
    ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___
    www.marclorenz.com
    www.facebook.com/marclorenzvisualization

    Comment


    • #3
      Even if it aint relevant just pointing out a problem in the code without trying it:

      Code:
      if obj.wireColor = source.wireColor
      This part needs to read
      Code:
      if obj.wireColor == source.wireColor
      single "=" is setting a value. For comparisons you need to use "==".

      Kind Regards,
      Thorsten

      Comment


      • #4
        ScriptSpot is your friend!

        http://www.scriptspot.com/blog/capit...ectbywirecolor

        I needed the same functionality for something similar a while ago, used this script as a start and edited it to do what I needed...
        | LinkedIn | Twitter | JCanimator.com |

        Comment

        Working...
        X