THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 03/09/2008 at 03:40, xxxxxxxx wrote:
Cinema 4D Version: 9.603
Platform: Windows ; Mac OSX ;
Language(s) : C++ ;
I have a file type for which I want to:
I can write a BitmapLoaderData or a SceneLoaderData for this, but if they are both registered, only the bitmap loader will get called - returning TRUE for BitmapLoaderData::Identify hides the scene loader (obviously). Since C4D now thinks the file is a bitmap, it creates a C4D material when a file is drag/dropped. That is not the desired result, since the file is one of my own materials, which I want to import into the Material Manager. So fine, just don't provide the bitmap loader - but how to generate a thumbnail in the Content Browser using a SceneLoaderData?
Regarding SceneLoaderData - drag/drop using this works fine from the Content Browser, which is registered using PLUGINFLAG_SCENELOADER_MERGEORIGINAL. However, drag/drop from another source (i.e. explorer/finder) always results in C4D opening a new document, regardless of the plugin's MERGEORIGINAL specification. Is there any way to prevent this new document being created?
Does anyone have a recommendation on other ways of dealing with this scenario? Optimally, there would be a third kind of loader...something simple which would work like BitmapLoaderData, but which would also get a notification when dropped/imported into C4D, allowing the implementer to perform the appropriate action.
On 08/09/2008 at 02:39, xxxxxxxx wrote:
I am not sure about what you trying to achieve but it sounds to me like you could use a dummy shader. Shaders can be stored in the content browser and they create a preview. You can also drag them into the material manager.
Regarding draging files from outside of Cinema (explorer/f nder, I don't think it is possible to prevent opening a new document.
On 08/09/2008 at 07:59, xxxxxxxx wrote:
I could have given a better description of what I'm dealing with. Basically, I am writing a plugin for a renderer which supports external material files; these files store their own preview bitmap. I am integrating the renderer's native format into my C4D plugin using a MaterialData-derived plugin material which knows how to read these files. So when my user is using the Content Browser, in addition to dragging any of my plugin materials that they may have stored previously as presets (no problem with thumbnails there), they should also be able to drag one of these non-C4D files from the file system and have it converted into a plugin material. This works fine using SceneLoaderData, with the exception of not being able to generate thumbnails for the file type.
I hope this explains things better. As far as I can tell, I basically need:
> a. a new kind of LoaderData
> - or -
> b. a 'CreateThumbnail' type of method to be added to SceneLoaderData
> - or -
> c. a way to tell C4D that I will handle the import for a BitmapLoaderData, rather than having it automatically inserted as a C4D Material
Additionally, it would be great if MERGEORIGINAL could be respected when the drag-source is somewhere other than the Content Browser.