THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 23/04/2005 at 18:28, xxxxxxxx wrote:
Cinema 4D Version: 8.012
Platform: Windows ; Mac ; Mac OSX ;
Language(s) : C++ ;
Alright, I've tried what 'the developers' suggest through Mikael and I see someone else with a success on his own import/export plugin. But the scaling value is always zero.
// Get Wavefront Import Scale
if (plug = FindPlugin(FORMAT_OBJIMPORT, C4DPL_SCENELOADER))
scaling = plug->GetDataInstance()->GetReal(OBJIMPORTFILTER_SCALE);
else MessageDialog("Wavefront Import Plug Not Found!");
I never get the MessageDialog. So, what is wrong here?
On 25/04/2005 at 15:30, xxxxxxxx wrote:
On 26/04/2005 at 01:12, xxxxxxxx wrote:
I can confirm that the code above *doesn't* work. I'm currently looking for an alternative method...
On 26/04/2005 at 02:16, xxxxxxxx wrote:
Hard to see what you are trying to do.
And you never get the MessageDialog because FORMAT_OBJIMPORT is a builtIn Plugin from MAXON and therefor _always_ found. But i am not sure if this is what you really wanted to know?
[Edit] havent seen mikaels posting before sending my answer, so maybe its only of little use, dont mind.
On 26/04/2005 at 08:34, xxxxxxxx wrote:
Well, according to a previous post (some time ago), the developers said that this should work:
BasePlugin *plug = FindPlugin(saver_id);
BaseContainer *bc = plug->GetDataInstance();
And another post, "Info from Dialog", whose title is misleading, concerns doing a similar thing using a written import/export plugin whose settings are stored in the Preferences.
So, yes, this is a built-in plugin and it is expected to be found. But there appears to be no data access to any part of it. I've tried GetDataInstance(), GetParameter(), and GetDescription() as well as using Mikaels 'Print' utilities for GeData/BaseContainer/Description to find anything. There doesn't seem to be any data to access. BaseContainer prints [-1,........] or something like that.
I would really hate, for a commercial product, to maintain two identical values - one in the Wavefront Import Preferences and another in my plugin - since I cannot do it programmatically. It'd be better if the user could just set Wavefront Import Preferences and my plugin extract that value for its use.
On 26/04/2005 at 10:17, xxxxxxxx wrote:
On a hunch, I tried something completely different (and no larch!).
// Get Wavefront Import Scale
if (bc = GetWorldPluginData(FORMAT_OBJIMPORT))
scaling = bc->GetReal(OBJIMPORTFILTER_SCALE);
MessageDialog("Wavefront Import Data Not Retrieved!");
This works! Solved finally!
Back to real work...
On 26/04/2005 at 12:27, xxxxxxxx wrote:
"On a hunch, I tried something completely different ..."
Welcome to the mystical world of confusion and grace,
leading to wisdom and faith by [ - please insert something useful here - at least i dont know how to get it out of the box]
On 26/04/2005 at 12:42, xxxxxxxx wrote:
I should probably start a new thread, but this is related.
What is up with SetWorldPluginData() in 8.012 SDK? When I try to use it and compile, I receive this linker error:
iPLoader.obj : error LNK2001: unresolved external symbol "int __cdecl SetWorldPluginData(long,class BaseContainer &,int)" ([email protected]@[email protected]@[email protected])
./Commercial/interPoser Ltd.cdl : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
This is in the same place as GetWorldPluginData() is called and no problems with it. The best that I can reckon is that there is a discrepancy between "c4d_general.h" and "OperatingSystem.h" in definition (one uses const BaseContainer&, the other BaseContainer* ). Is this something that may require an api_lib recompilation?
On 26/04/2005 at 13:22, xxxxxxxx wrote:
That was it. Needed to change "c4d_general.h" by adding the missing 'const'.
Nonetheless, SetWorldPluginData() doesn't seem to work in this regard, at least not in 8.012 SDK. This is only a test to see if I can have the user set the value with my plugin and temporarily set the Wavefront Import scale when loading files of this type. No such luck.