Results 1 to 4 of 4

Thread: Maya Ramp Control

  1. #1
    Join Date
    Dec 2004
    Location
    Moscow, Russia
    Posts
    682

    Default Maya Ramp Control

    It's more Maya GUI relative question.
    How can I use ramp control with mental ray shaders? I mean "AEaddRampControl" command in AETemplete.
    It works fine with MayaAPI node (plugin).
    rampControlPlugin.jpg
    But print error with same node generated from mental ray shader.
    Code:
    ../scripts/AETemplates/AEaddRampControl.mel line 281: Attribute is not a ramp.
    rampControlError.jpg
    Shader itself works fine, the issue only with GUI.
    What is wrong? Is it possible?

    It's my AETemplete:
    Code:
    global proc AEp_flameTemplate( string $nodeName )
    {
    	AEswatchDisplay $nodeName;
    	editorTemplate -beginScrollLayout;
    		editorTemplate -beginLayout "Main" -collapse 0;
    			AEaddRampControl ($nodeName+".density");
    			AEaddRampControl ($nodeName+".color");
    			editorTemplate -label "Step Size" -addControl "stepSize";
    			editorTemplate -label "Jitter" -addControl "jitter";
    		editorTemplate -endLayout;
    		AEdependNodeTemplate $nodeName;
    		editorTemplate -addExtraControls;
    
    	editorTemplate -endScrollLayout;
    }
    And mi shader declaration:
    Code:
    declare shader
    		color					#: shortname "oc"
    	"p_flame" (
    		array struct	"density" {
    			scalar	"density_Position",		#: shortname "denp"
    			scalar	"density_FloatValue",	#: shortname "denfv"
    			integer	"density_Interp"		#: shortname "deni"
    			},						#: shortname "den"
    		array struct	"color" {
    			scalar	"color_Position",	#: shortname "clrp"
    			color 	"color_Color",	#: shortname "clrcv"
    			integer	"color_Interp"	#: shortname "clri"
    			},						#: shortname "clr"
    		scalar		"stepSize",		#: shortname "step" min 0.0 max 100.0 softmin 0.01 softmax 1.0 default 0.1
    		scalar		"jitter"		#: shortname "jitter" min 0.0 max 1.0 default 0.5
    	)
    	version 1
    	apply volume
    	volume level 1
    	#: nodeid 333052
    end declare
    Pavel Ledin

  2. #2
    Join Date
    Dec 2004
    Location
    Marina Del Rey, California
    Posts
    4,143

    Default

    On initial glance, I don't see AEaddRampControl used by anything in mentalrayForMaya scripts. It is not obvious why it shouldn't work.

    That last error is because an edit of the colorRamp gradientControl; it fails as if the creation of it never happened. Ahhh, that is the creation line at 281,noted by the first error. It isn't identifying that color is a ramp attribute. So that is why the second error at 437 happens. There may be some special identifiers of ramp attributes that need to be set.

    Not seeing anything obvious looking through AEaddRampControl.mel
    Last edited by bart; November 11th, 2015 at 04:27.
    Barton Gawboy

  3. #3
    Join Date
    Dec 2004
    Location
    Moscow, Russia
    Posts
    682

    Default

    Yes, the common error is: 281: Attribute is not a ramp.
    Ramp control is never used in any mentalray shader, so there is no example in Maya.
    I also assume that a issue in special identifiers. But a question, in which? What should I add to mi file that the Ramp started working?
    Pavel Ledin

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

    Default

    The Node Factory generates nodes from mi declarations. Right now, there is nothing given to the node factory that identifies an input as a ramp. Trying to determine how feasible this is.
    Barton Gawboy

Posting Permissions

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