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

From The Foundry MODO SDK wiki
Jump to: navigation, search
(Problems with posted code: new section)
m
Line 1: Line 1:
 +
== Problems with posted code ==
  
 
<syntaxhighlight lang="cpp">
 
<syntaxhighlight lang="cpp">
Line 50: Line 51:
  
 
As is this won't work as published.
 
As is this won't work as published.
 
== Problems with posted code ==
 
 
1
 

Revision as of 16:09, 9 August 2019

Problems with posted code

			LxResult
		pkg_TestInterface (
			const LXtGUID		 guid)			LXx_OVERRIDE
		{
			_inst_spawn.TestInterfaceRC (guid);
		}
guid needs to be a pointer
const LXtGUID *guid
or the IDE complains.

A function that has a return of LxResult needs to return something.


			/*
			 *	Spawn the mesh operation and copy the time channel to
			 *	it for the size.
			 */
 
			meshOp = spawner.Alloc (meshOp_obj);
			if (meshOp)
				meshOp->size = time;

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.

	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;
                  }

As is this won't work as published.