Hi!
I have built a custom model processor with a set of properties (e.g. "UseSpecular", etc.) than ca be set from visual studio.
In my model processor, I have overridden ConvertMaterial in order to redirect material processing to my custom material processor. For my custom material processor to be able to select the appropriate material file, it needs to know the values of the aforementioned properties (e.g. whether to use specular lighting or not, etc.)
Unfortunately I can't figure out how to pass that information.
I've tried to use the OpaqueDataDictionary, but in the MaterialProcessor.Process method, the information is apparently "lost". Code sample:
| // In CustomModelProcessor |
| protected override MaterialContent ConvertMaterial(MaterialContent _material, ContentProcessorContext _context) |
| { |
| OpaqueDataDictionary data = new OpaqueDataDictionary(); |
| data.Add("UseSpecular", this.UseSpecular); |
| |
| return _context.Convert<MaterialContent, MaterialContent>(_material, "CustomMaterialProcessor", data); |
| } |
| |
| // In CustomMaterialProcessor |
| public override MaterialContent Process(MaterialContent input, ContentProcessorContext context) |
| { |
| if (input.OpaqueData.ContainsKey("UseSpecular")) // false! |
| // ... |
| } |
Can anyone help on this?