Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report for Bug 33084 on
Developer Community or GitHub if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
SCNMaterialProperty.Contents should be able to be set to a variety of objects, including CoreGraphics objects.
However, the binding forces NSObjects and thus prevent CGColor use.
The ContentColor binding forces you to use UIColor and doesn't support CGColor.
Similar problems occur for CGImage and the ContentImage binding.
These are important to support because SceneKit is multithreaded but the UIColor and UIImage classes are locked to the UI thread. For instance, thumbnail generation is usually done in a background thread but this cannot be done because of this binding.
This is also a bug on the Mac binding. Please fix both. :-)
(Also, the names are strange. Why is one pluralized "Contents", and the others are "Content"? I think the names should have been ColorContents not ContentColor since the color is the content, not an attribute of the content.)
Yes, it seems the API should accept an INativeObject (not an NSObject).
> UIColor and UIImage classes are locked to the UI thread.
The UIColor type is marked as [ThreadSafe] in our bindings and you should be able to use it in background threads. For UIImage it's not the entire API, but most members are marked as [ThreadSafe].
If you're hitting a case where that does not work please attach a test case as something (else) must be wrong and needs to be verified.
Thanks for the clarifications. The last time I tried to use a UIColor on a background thread it blew up with a Xamarin exception. But that might have been literally years ago. I've just taken it as doctrine. Nice to know it works!
@Frank - Here's a quick patch to hack in setting a CGColor: