Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Max plus combine materials

Max plus combine materials

elpie89
Advocate Advocate
829 Views
6 Replies
Message 1 of 7

Max plus combine materials

elpie89
Advocate
Advocate

Does anyone know how to call a method with this signature?

CombineMaterials(Mtl mat1, Mtl mat2, int & mat2Offset)

How to pass the BitWise operator?

Thanks

0 Likes
830 Views
6 Replies
Replies (6)
Message 2 of 7

Swordslayer
Advisor
Advisor

That's not a bitwise operator, it indicates you're supposed to pass that by reference rather than by value (it will save the resulting material count into the variable).

0 Likes
Message 3 of 7

elpie89
Advocate
Advocate

Ok thanks, can you write a really simple example.

Because I'm really struggling with this

Thanks again

0 Likes
Message 4 of 7

elpie89
Advocate
Advocate

I tried everything with this.

Asked on the forum of techartist.org, there is an entire discussion with no solution

Is this possible to do from python?

0 Likes
Message 5 of 7

Swordslayer
Advisor
Advisor

Python doesn't support the option of by-reference passing and it's usually handled by the library that wants to make it available (like with ctypes.byref when using ctypes). I don't think the setup for the SWIG that wraps the C++ functions in max was done with that in mind (but don't ask me, I would never use MaxPlus in production and in general avoid python in max as it's the slowest and least stable choice you can make).

0 Likes
Message 6 of 7

denisT.MaxDoctor
Advisor
Advisor

@Swordslayer wrote:

 (but don't ask me, I would never use MaxPlus in production and in general avoid python in max as it's the slowest and least stable choice you can make).


100% agree

 

0 Likes
Message 7 of 7

elpie89
Advocate
Advocate

I'm starting to understand why..thanks Autodesk for this great tools

0 Likes