Results 1 to 6 of 6

Thread: ramp based phenomenon

  1. #1
    Join Date
    May 2005
    Location
    London
    Posts
    24

    Default ramp based phenomenon

    Hi all I'm trying to make a phenomenon which uses a ramp (struct array) inside it. :

    Code:
    declare phenomenon  
    	"ar_rampShader" (		
    		integer		"interpolation", #:enum "0:1:2:3:4" default 1	
    		array struct	"colorEntryList" {
    			scalar		"position",
    			color		"color"
    			},
    		color "diffuse" default .5 .5 .5,
    		integer		"mode",
    		array light	"lights"		
    	)
    	
    	shader "diffuse"
    		"ar_diffusePass" (
    		"diffuse" = interface "diffuse",
    		"opacity" 1. 1. 1. 1.,
    		"mode" = interface "mode",
    		"lights" = interface "lights"
    		)
    
    
    	shader "place2dTexture1"
    		"maya_place2dtex" (
    			"uvCoord" 0. 0. 0.,
    			"uvFilterSize" 0. 0. 0.,
    			"coverage" 1. 1. 0.,
    			"translateFrame" 0. 0. 0.,
    			"rotateFrame" 0.,
    			"mirrorU" off,
    			"mirrorV" off,
    			"stagger" off,
    			"wrapU" on,
    			"wrapV" on,
    			"repeatUV" 1. 1. 0.,
    			"offset" 0. 0. 0.,
    			"rotateUV" 0.,
    			"noiseUV" 0. 0. 0.
    			)
    
    	shader "ramp"
    		"maya_ramp" (
    		"interpolation" = interface "interpolation",
    		"colorEntryList" = interface "colorEntryList",
    		"uvCoord" = "place2dTexture1.outUV",
    		"uvFilterSize" = "place2dTexture1.outUvFilterSize"
    			)
    	
    	shader "mix"
    		"mib_color_mix" (
    		"num" 2,
    		"mode_0" 0,
    		"mode_1" 2,
    		"weight_0" 1.,
    		"weight_1" 1.,
    		"color_0" = "diffuse",
    		"color_1" = "ramp.outColor",
    		"color_base" 0. 0. 0. 1.
    			)
    
    	root= "mix"
    	version 1
    	apply material
    	#:nodeid 1107711
    
    end declare
    It all loads fine how ever the ramp element doesn't seem to be affecting anything.

    Is there anything other connections that need to be made between the interface and the ramp "colorEntryList" attribute, if so what is the syntax for this?

    I'm using maya2008 to test the shader out.

    Any help much appricated.

    -- Ash
    << Ashley Retallack >>

  2. #2
    Join Date
    Dec 2004
    Location
    Marina Del Rey, California
    Posts
    3,069

    Default Re: ramp based phenomenon

    Can you post the declaration for maya_ramp for comparison on how it uses the color entry list?

    I could but I'm not in front of my Maya machine right now.
    Barton Gawboy
    Training and Special Projects, NVIDIA ARC
    LAmrUG Forum Originator

  3. #3
    Join Date
    May 2005
    Location
    London
    Posts
    24

    Default Re: ramp based phenomenon

    Hi Bart, here you go:

    Code:
    # Ramp
    #
    declare shader
    	struct {
    		color		"outColor",
    		scalar		"outAlpha"
    	} "maya_ramp" (
    		integer		"type",
    		integer		"interpolation",
    		array struct	"colorEntryList" {
    			scalar		"position",
    			color		"color"
    			},
    		scalar		"uWave",
    		scalar		"vWave",
    		scalar		"noise",
    		scalar		"noiseFreq",
    		scalar		"hueNoise",
    		scalar		"satNoise",
    		scalar		"valNoise",
    		scalar		"hueNoiseFreq",
    		scalar		"satNoiseFreq",
    		scalar		"valNoiseFreq",
    		# Inherited from Texture2d
    		vector		"uvCoord",
    		vector		"uvFilterSize",
    		scalar		"filter",
    		scalar		"filterOffset",
    		boolean		"invert",
    		boolean		"alphaIsLuminance",
    		color		"colorGain",
    		color		"colorOffset",
    		scalar		"alphaGain",
    		scalar		"alphaOffset",
    		color		"defaultColor"
    		)
    	apply texture
    	version	2
    end declare
    cheers for any help

    -Ash
    << Ashley Retallack >>

  4. #4
    Join Date
    Dec 2004
    Location
    Marina Del Rey, California
    Posts
    3,069

    Default Re: ramp based phenomenon

    Do you have standalone to test to see if it works without the ramp UI?

    Next, are you really asking about how the UI is presented in Maya?

    That is handled by mel scripts for special things like the ramp. I doubt the auto parsing mechanism in the Node Factory would know what to do with this input data type.

    I'm no mel expert, but I see related stuff in scripts/AETemplates/AErampShaderTemplate.mel for example
    Barton Gawboy
    Training and Special Projects, NVIDIA ARC
    LAmrUG Forum Originator

  5. #5
    Join Date
    Dec 2004
    Location
    Marina Del Rey, California
    Posts
    3,069

    Default Re: ramp based phenomenon

    I stand corrected, Maya 2008 SP 1 knows how to parse array struct arguments from an mi declaration. Whoo hoo.
    Barton Gawboy
    Training and Special Projects, NVIDIA ARC
    LAmrUG Forum Originator

  6. #6
    Join Date
    Aug 2011
    Posts
    24

    Default

    I'm having the same trouble in Maya 2012 (mental ray 3.9.1.43).
    Is there any way to fix this problem?

Posting Permissions

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