Here is what I'm trying to achieve from maxscript in order to get my classes back
I thaught just typing "using MyNamespace;" in a scriptOp would work but no..
I wanted to do it from maxscript for convenience and of course for not having to restart max, but if prebuild dll is the only way, I'll do it.
I'm writing a Max helper pugin for character rigging purposes and IK solving, for now in maxscript/C# and maybe totally C# later..,
and I want it to work for both rigs and tyActors!
It would be great if you could point me how to load/access my classes in the scriptOp?
whether it be on max startup or on fly, using maxscript, cs file, or prebuilt dll...
thanks!
I thaught just typing "using MyNamespace;" in a scriptOp would work but no..
Code:
fn MyAssembly =
(
source =
"////////////////////////////////////////////////////// C# ////////////////////////////////////////////////////////////////
using System;
using Autodesk.Max;
using Autodesk.Max.Wrappers;
using tfcpp; // tyFlow namespace ???
namespace MyNamespace
{
public class MyClass
{
public static void myMethod()
{
// bla bla using tyFlow.classes eventually
}
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
"
local csharpProvider = dotnetobject "Microsoft.CSharp.CSharpCodeProvider"
local compilerParams = dotnetobject "System.CodeDom.Compiler.CompilerParameters"
compilerParams.ReferencedAssemblies.Add "Whatever is needed"
compilerParams.GenerateInMemory = on
local compilerResults = csharpProvider.CompileAssemblyFromSource compilerParams #(source)
(compilerResults.CompiledAssembly).CreateInstance "MyNamespace.MyClass"
)
I wanted to do it from maxscript for convenience and of course for not having to restart max, but if prebuild dll is the only way, I'll do it.
I'm writing a Max helper pugin for character rigging purposes and IK solving, for now in maxscript/C# and maybe totally C# later..,
and I want it to work for both rigs and tyActors!
It would be great if you could point me how to load/access my classes in the scriptOp?
whether it be on max startup or on fly, using maxscript, cs file, or prebuilt dll...
thanks!