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
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
Problems with the code
+
== Problems with posted code ==
  
 
<syntaxhighlight lang="cpp">
 
<syntaxhighlight lang="cpp">
Line 11: Line 11:
  
 
guid needs to be a pointer <syntaxhighlight lang="cpp">const LXtGUID *guid</syntaxhighlight> or the IDE complains.
 
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.
 
A function that has a return of LxResult needs to return something.
 
----
 
----
Line 48: Line 50:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
As is this won't work as published.
+
As is this won't work as published.  I don't want to make the changes on the wiki because I'm not sure if I would be doing it correctly or causing other issues with the code.

Latest revision as of 09:10, 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. I don't want to make the changes on the wiki because I'm not sure if I would be doing it correctly or causing other issues with the code.