THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 10/09/2011 at 12:40, xxxxxxxx wrote:
Cinema 4D Version: 12
Language(s) : C++ ;
in my TagData I Sample the color-channel Shader of a Material. I noticed, that I can just sample for example a Color Shader or a Bitmap Shader. If I try to sample a Layer Shader or a Gradient, the Sample method gives me an Access Violation Error.
Did I forget something? Btw. I only initialize the ChannelDatas UV value 'p' when calling the Sample(..) method. Do I have to initialize more values on the ChannelData, if yes, which ones?
On 12/09/2011 at 05:14, xxxxxxxx wrote:
You need to initialize every member variable of ChannelData because the constructor isn't initializing them on its own. You can pass NULL to ChannelData::vd but some shaders will not return anything useful because they need a valid initialized VolumeData.
On 12/09/2011 at 09:01, xxxxxxxx wrote:
Ok, thanks for the information. How can I know if the Shader sampled correctly? Or is there a list of shaders that will need a VolumeData?
I need to figure out which Shaders will work, otherwise there will be an exception at runtime...
On 12/09/2011 at 10:25, xxxxxxxx wrote:
There is no list of shaders that need the VolumeData. Basically all shaders that do more than just UV based calculation need the VolumeData.
There should be no exception at runtime if the shader is written well. Just the returned result will not make much sense.
On 12/09/2011 at 10:51, xxxxxxxx wrote:
Ok, makes sense
Most likely the exception came from my (formerly) not fully initialized ChannelData.