MAXSCRIPT: IGRADIENT V1.0

Max scripts

Moderatorer: Super Moderatorer, Admins

Brukeravatar

Trådstarter
tassel
Innlegg: 3987
Registrert: man 26 sep, 2005
Sted: Oslo
Kontakt:

MAXSCRIPT: IGRADIENT V1.0

Legg innav tassel » fre 14 jun, 2013

Kunne vært gjort mye mer snedig, satt bare og lekte meg litt i går med Nik Clark’s ColorGrid eksempel som dere finner her:
http://www.maxforums.org/threads/maxscr ... /0001.aspx


Kode: Velg alt

try(destroyDialog ::InteractiveGradient)catch()
 
    rollout InteractiveGradient "IGradient V1.0"
    (
        group "Interactive Gradient:"
        (
            colorpicker cp1 color:[0,0,255] width:80 height:30 align:#left across:2
            colorpicker cp2 color:[255,255,0] width:80 height:30 align:#right
        )
         
        group "Wirecolor on Selection:"
        (
            colorpicker cp3 "Change Wirecolor:" width:162 height:20 color:[100,100,100] align:#left
        )
         
        on cp3 changed new_col do
        (
            for obj in selection do selection.wirecolor = new_col
        )
         
        on cp1 changed val do
        (
            print (val as point4) -- Point4 is MR Colors
            print (val as point3) -- Point3 is RGB Colors
             
            color_01 = cp1.color
            color_02 = cp2.color
             
            stepsize_r = (color_02.r - color_01.r)/$.count
            stepsize_g = (color_02.g - color_01.g)/$.count
            stepsize_b = (color_02.b - color_01.b)/$.count
             
            for i = 1 to $.count do
            (
                newColor = (color ((i*stepsize_r)+ color_01.r-stepsize_r) ((i*stepsize_g)+color_01.g-stepsize_g) ((i*stepsize_b)+color_01.b-stepsize_b))
                $[i].wirecolor = newColor
            )
        )
         
        on cp2 changed val do
        (
            print (val as point4) -- Point4 is MR Colors
            print (val as point3) -- Point3 is RGB Colors
             
            color_01 = cp1.color
            color_02 = cp2.color
             
            stepsize_r = (color_02.r - color_01.r)/$.count
            stepsize_g = (color_02.g - color_01.g)/$.count
            stepsize_b = (color_02.b - color_01.b)/$.count
             
            for i = 1 to $.count do
            (
                newColor = (color ((i*stepsize_r)+ color_01.r-stepsize_r) ((i*stepsize_g)+color_01.g-stepsize_g) ((i*stepsize_b)+color_01.b-stepsize_b))
                $[i].wirecolor = newColor
            )
        )
         
    )
     
    createDialog InteractiveGradient height:120 width:190 pos:[200,250]

Gå tilbake til «Max scripts»

Hvem er online

Brukere i dette forumet: Ingen registrerte brukere og 1 gjest

cron