C++ how to create a customproperty
| Date : Thu, 10 Apr 2008 15:52:38 -0400 (EDT) |
| To : xsi(at)Softimage.COM |
| From : dominic bélanger <lowtunes1(at)yahoo.ca> |
| Subject : C++ how to create a customproperty |
Hi guys , i would like to create my customproperty in my execute callback and after in another Callback i would like to add my parameters .Now if im invoke my command it just create an empty customproperty and the command by pass the Define CALLBACK .
this is my code snipet someone have an idea
thanks
XSIPLUGINCALLBACK CStatus PassLoader_Execute( CRef& in_ctxt )
{
Application().LogMessage(L"PassLoader_Execute");
Context ctxt( in_ctxt );
Application App ;
Project proj = App.GetActiveProject();
Scene scn = proj.GetActiveScene();
Model root = scn.GetRoot();
CValueArray args = ctxt.GetAttribute(L"Arguments");
CustomProperty op;
root.AddCustomProperty(L"PassBuilder", false, op );
ctxt.PutAttribute( L"ReturValue",(CRef)op);
// Return CStatus::Fail if you want to raise a script error
return CStatus::OK;
}
XSIPLUGINCALLBACK CStatus PassBuilder_Define(CRef& in_ctxt)
{
//Application().LogMessage(L"EAPassBuilder_Define");
Context ctxt(in_ctxt);
CustomProperty op;
op = ctxt.GetSource();
//Factory fact = Application().GetFactory() ;
Parameter MyParam ;
op.AddParameter(L"StartFrame", //ScriptName
CValue::siInt4, //Type
siAnimatable, // (siPersistable is automatic)
L"StartFrame", L"", // Name, description
0, // Default
-10000, 10000, //
Min Max
0, 10000 // UIMin UIMax
, MyParam);
op.AddParameter(L"EndFrame", //ScriptName
CValue::siInt4, //Type
siAnimatable, // (siPersistable is automatic)
L"EndFrame", L"", // Name, description
0, // Default
-10000, 10000, // Min Max
0, 10000 // UIMin UIMax
, MyParam);
// As this is a simulation we need to be evaluated even if the parameters don't change
//op.PutAlwaysEvaluate( true ) ;
return CStatus::OK ;
}
Découvrez les photos les plus intéressantes du jour!
- Follow-Ups:
- Re: C++ how to create a customproperty
- From: Ben Rogall <XSI_list(at)shaders.moederogall.com>
- Re: C++ how to create a customproperty
| DATE: | << | >> | THREAD: | << | >> | INDEX: | Main | Thread |
|---|
- Previous by Date: in which view the selection was made? scripting...
- Next by Date: in which view the selection was made? scripting...
- Previous by Thread: in which view the selection was made? scripting...
- Next by Thread: in which view the selection was made? scripting...
- Index(es):
| Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available. |