Difference between revisions of "Talk:Mesh Operation - Manual implementation"

From The Foundry MODO SDK wiki
Jump to: navigation, search
(Created page with "Problems with the code <syntaxhighlight lang="cpp"> LxResult pkg_TestInterface ( const LXtGUID guid) LXx_OVERRIDE { _inst_spawn.TestInterfaceRC (guid); } <...")
 
m (changed to :"topic")
Line 1: Line 1:
Problems with the code
 
  
<syntaxhighlight lang="cpp">
 
LxResult
 
pkg_TestInterface (
 
const LXtGUID guid) LXx_OVERRIDE
 
{
 
_inst_spawn.TestInterfaceRC (guid);
 
}
 
</syntaxhighlight>
 
 
guid needs to be a pointer <syntaxhighlight lang="cpp">const LXtGUID *guid</syntaxhighlight> or the IDE complains.
 
----
 
A function that has a return of LxResult needs to return something.
 
----
 
<syntaxhighlight lang="cpp"> /*
 
* Spawn the mesh operation and copy the time channel to
 
* it for the size.
 
*/
 
 
meshOp = spawner.Alloc (meshOp_obj);
 
if (meshOp)
 
meshOp->size = time;</syntaxhighlight>
 
 
will give an error that Class "MeshOp" has no member "size".  "size" is declared in the "mop_Evaluate" function but "_size" is the variable in the class.
 
 
<syntaxhighlight lang="cpp"> class MeshOp : public CLxImpl_MeshOperation
 
{
 
public:
 
static void initialize (){...}
 
    LxResult
 
mop_Evaluate (
 
ILxUnknownID mesh_obj,
 
LXtID4 type,
 
LXtMarkMode mode) LXx_OVERRIDE
 
{
 
CLxUser_Mesh mesh (mesh_obj);
 
 
        ... <snip> ...
 
LXtVector pos;
 
double size = 0.5;
 
                                ... <snip> ...
 
return result;
 
}
 
double _size;
 
                  }
 
 
</syntaxhighlight>
 
 
As is this won't work as published.
 

Revision as of 16:07, 9 August 2019