Posted by: | psaii | |
Data created: | 12 August 2010 |
Hey Marsel, Question 2: I based my custom material on Mtl. I know that a scripted material based on StdMat works under MentalRay. I was wondering if basing my custom material on StdMtl (not sure of the syntax) would fix the issue. The only thing I don't get is why we have to implement so many abstracts methods when subclassing a type like "StdMat". Is there a reason all these abstracts methods are abstract ? shouldn't they be just "virtual" ? Thanks, | |||
12 August 2010
#2249 | |||
Hi Michel,
Great to hear!
I assume that you refer to a texmap that would with with MR (not a material)? From what I know, in C++ to get your texmap properly translated to MR you need to do several things:
If you do that and call the Init() methods of IMtlRender_Compatibility_MtlBase and imrShaderTranslation_ClassInfo Max will show your map when both- normal and MR renderers are active, and if you use the map with MR renderer it'll pass/translate the parameter block parameters to your MR shader where you can use them to produce your result. I haven't even started thinking about how to translate something like that to Max.NET to be honest. Multiple inheritance plays an important role here and its not supported in .NET There would probably need to be a special case for creating MR-compatible texmaps through Max.NET
All the abstract methods are translated from pure virtual methods in C++. If a method is just marked virtual it should also be virtual in the Autodesk.Max.Plugins version of the class. This is the way it should work, maybe something is not right though. I guess I'll need to make a Mtl example to figure these things out. Marsel Khadiyev (Software Developer, EPHERE Inc.) | |||
13 August 2010
#2257 | |||
Thanks for the information, that helps ;) Regarding the last part (pure virtuals), if you take the standard material for example, StdMat2 : MAX.Net : Hope it helps, | |||
13 August 2010
#2261 | |||
Aha, I see that you're referring to StdMtl2 which is, again, located in samples (not part of Max's main SDK). StdMat2 is a different class (which I presume StdMtl2 derives from). In StdMat2 IsFaceted is abstract:
and thats what Max.NET wraps. I think this is part of the same discussion about including these sample classes in the SDK. I need to consult with some people about doing that for next build, will let you know. Marsel Khadiyev (Software Developer, EPHERE Inc.) | |||
13 August 2010
#2263 | |||
Hehe ;) Good, that explains it ;) was wondering why two different names existed for the material hehe, Thanks | |||
13 August 2010
#2265 | |||
Got to love the (lack of) naming conventions sometimes :) Marsel Khadiyev (Software Developer, EPHERE Inc.) |