Results 1 to 6 of 6

Thread: [MAXScript] ViewPort Background Color

  1. #1
    Game Artist
    Join Date
    Mar 2009
    Posts
    16

    Post [MAXScript] ViewPort Background Color



    Hello every one, I hope it is okey to post topics about MAXScripts here.

    I'm trying to quickly change the background colour of my viewport to black through the Listener. I type:

    Code:
    setVPortBGColor(color 0 0 0)
    and I get this output:

    Code:
    (color 0 0 0)
    But still, the viewport is grey, nothing happens.

    Any suggestions on how to fix this? What I'm trying to create in the end is a simple UI icon that toggles between grey (standard) and black viewport colour.

    Cheers!

  2. #2
    undefined
    Join Date
    Sep 2009
    Posts
    9

    Default

    setVPortBGColor seems to be broken in max 2010. As an alternative you can use:

    Code:
    SetUIColor 41 (color 0 0 0)
    colorMan.repaintUI #repaintAll

  3. #3
    Game Artist
    Join Date
    Mar 2009
    Posts
    16

    Default

    Ha! That's awesome, thanks mate! :D :D

  4. #4
    Game Artist
    Join Date
    Mar 2009
    Posts
    16

    Smile

    Yeay! I finally got it working! :D

    This is my first MAXScript ever! :) Its function is very straight forward; it allows you to quickly toggle between the standard grey and pitch black colour of all the viewports.

    The black viewport makes it easier to see particles when working with Particle Flow and the standard grey is my prefered option when working with other stuff. So this is simply an easy way to toggle back and forth between workflow.

    Here's the final code that got it to work for me:

    Code:
    CurrentColor = (GetUIColor 41*255) as color
    
    if CurrentColor != color 0 0 0 then
    (
    SetUIColor 41 (color 0 0 0)
    colorMan.repaintUI #repaintAll
    )
    else
    (
    SetUIColor 41 (color 131 131 131)
    colorMan.repaintUI #repaintAll
    )
    Feel free to try it out, you can download it here:http://www.nanne-san.com/files/maxsc...ourSwitch01.ms

    Let me know if there are any bugs. It works for me in max 9 and 2010.

    Cheers mate, thanks for your help! :)

  5. #5

  6. #6
    Game Artist
    Join Date
    Mar 2009
    Posts
    16

    Default

    Yes, I saw that and I tried my best from what I red there before posting here. But I didn't get a hang of it until you pointed out what I was suppose to look for, thanks! :)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •