THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 16/01/2008 at 09:16, xxxxxxxx wrote:
Cinema 4D Version: 10.5
Platform: Mac OSX ;
Language(s) : C++ ;
OK, here it is. My first C++ question
I want to create a new material. Isn't this done with:
> BaseMaterial *mat = Alloc(Mmaterial);
I get a compiler error:
> error: 'Alloc' was not declared in this scope
On 16/01/2008 at 10:22, xxxxxxxx wrote:
better to use
BaseMaterial *mat = BaseMaterial::Alloc(Mbase);
On 16/01/2008 at 10:24, xxxxxxxx wrote:
BaseMaterial* mat = BaseMaterial::Alloc(Mmaterial);
There is no generic Alloc() method. Use the static Alloc() associated with the class type.
On 16/01/2008 at 11:51, xxxxxxxx wrote:
OK, I'm now trying to use this new material, called 'mat' and assign it to a TextureTag. Like this:
> BaseContainer *container = tag- >GetDataInstance();
> container->SetData(TEXTURETAG_MATERIAL, mat);
I get a new compiler error:
> error: conversion from 'BaseMaterial*' to 'const GeData' is ambiguous
What does this mean? Should work like this, no?
On 16/01/2008 at 12:44, xxxxxxxx wrote:
Seems easy enough.
On 16/01/2008 at 14:28, xxxxxxxx wrote:
Hm, I think this is easy enough. But what if I really really wanted to use containers for this?
On 16/01/2008 at 15:21, xxxxxxxx wrote:
You could try:
but I can't guarantee that these work.
On 21/01/2008 at 02:12, xxxxxxxx wrote:
Check the example below if you really want to use a container.
> AutoAlloc <BaseLink> link;
> if(!link) return FALSE;
> link->SetLink(mat); //mat is my Basematerial
> GeData d(link);