Announcement

Collapse
No announcement yet.

SDK - how to use list params?

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

  • SDK - how to use list params?

    Hi,

    I try to create my first own texture node. For this node I need an array of textures as input. I had a look into the mtlMulti and tried to use the same parameters like this:

    Code:
    struct MegaTex_Params: VRayParameterListDesc {
    	MegaTex_Params(void) {
    		// Add the parameters
    		addParamTexture("Col1");
    		addParamColor("Col2",Color(1.0f,0.0f,0.0f));
    		addParamPlugin("TextureList", EXT_TEXTURE, 0, "A list of textures.");
    	}
    };	
    
    class MegaTex: VRayTexture {
    	MegaTex(VRayPluginDesc *pluginDesc):VRayTexture(pluginDesc) {
    		// Set parameter caches
    		paramList->setParamCache("Col1", &col1);
    		paramList->setParamCache("Col2", &col2);
    		paramList->setParamCache("TextureList", &txtPlugins);
    	}
    
    	void renderBegin(VR::VRayRenderer *vray);
    	void renderEnd(VR::VRayRenderer *vray);
    	void frameBegin(VR::VRayRenderer *vray);
    	void frameEnd(VR::VRayRenderer *vray);
    
    	AColor getTexColor(const VRayContext &rc);
    	void getTexColorBounds(AColor &cmin, AColor &cmax);
    	Vector getColorBumpGradient(const VRayContext &rc);
    
    	PluginBase* getPlugin(void) { return (PluginBase*) this; }
    private:
    	// Cached parameters
    	TextureInterface *col1;
    	TextureInterface *col2;
    	VRayPluginList txtPlugins;
    	ShadeCache<AColor, true, false> shadeCache;
    };
    .....
    ...
    The "Color1" and "Color2" attributes appear in maya if I load the shader from the Create menu. But there is no sign of a list parameter.

    Any idea whats wrong in this code?

  • #2
    There is nothing wrong with the code; the automatic UI generator does not support list parameters at the moment. One way to do it is to create a fixed number of parameters instead (tex0, tex1... etc). Or if you are prepared to wait for a few days, we can implement this...

    Best regards,
    Vlado
    I only act like I know everything, Rogers.

    Comment


    • #3
      An implementation would be great, waiting some days is no problem.

      Comment

      Working...
      X