question

Alan Jones avatar image
Alan Jones asked ·

Parameters when using code rather than mtd files

Hi all,

So I can't find any examples of how to create parameter registrations when you're using c++ rather than mtd files. Is this possible? There weren't any obvious function names that appeared like they would add the [attr type] blah blah data you see in the adding parameter examples here https://docs.arnoldrenderer.com/display/A5AFMUG/Adding+Parameters

I'm guessing I'll be told I have to switch to mtd (sad face), but I'd rather make things as self contained as possible, rather than having many files as that increases the opportunity for people to get it wrong.

In my case this is for a camera node, incase that changes anything.

Cheers,

Alan.

arnoldmtoashaders
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Stephen Blair avatar image
Stephen Blair answered ·

You can do it like this:

AiMetaDataSetInt(nentry, "myParam", "default", 10

plug-ins\mtoa.mtd has all the metadata used by MtoA



1 comment Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Thanks so much. Super appreciated.

0 Likes 0 · ·
Stephen Blair avatar image
Stephen Blair answered ·

In node_parameters you can call things like AiMetaDataSetBool

instead of using the mtd file to set the metadata on parameters registered by the plugin


1 comment Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Hi Stephen,

Thanks, how do I get this expose to camera parameter in the maya interface?

As below, just use the same value as the parameter registration? Jus declaring the parameter with AiParameterInt hasn't been sufficient to get them appearing for me.

node_parameters

{

AiParameterInt("myParam", 7);

AiMetaDataSetInt(nentry, NULL, "myParam", ???whatDoIPutHereToGetTheValueOfTheRegisteredParameter???):

}

Cheers,

Alan.

0 Likes 0 · ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Welcome to the Arnold Answers community.

This is the place for Arnold renderer users everywhere to ask and answer rendering questions, and share knowledge about using Arnold, Arnold plugins, workflows and developing tools with Arnold.

If you are a new user to Arnold Answers, please first check out our FAQ and User Guide for more information.

When posting questions, please be sure to select the appropriate Space for your Arnold plugin and include the plugin version you are using.

Please include images, scene and log files whenever possible as this helps the community answer your questions.

Instructions for generating full verbosity log files are available for MtoA, MaxtoA, C4DtoA, HtoA, KtoA, and Kick.

If you are looking for Arnold Documentation and Support please visit the Arnold Support site.

To try Arnold please visit the Arnold Trial page.

Bottom No panel present for this section.