Mesh Operation - Manual implementation

From The Foundry MODO SDK wiki
Revision as of 16:10, 9 August 2019 by Cgolchert (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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.