Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Register
    • Login

    Wavefront Import Scale -still not working

    Scheduled Pinned Locked Moved SDK Help
    9 Posts 0 Posters 806 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      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:

      User Information:
      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  
           BasePlugin* plug;  
           if (plug = FindPlugin(FORMAT_OBJIMPORT, C4DPL_SCENELOADER))  
           {  
                GePrint("PluginName: "+plug->GetName());  
                scaling = plug->GetDataInstance()->GetReal(OBJIMPORTFILTER_SCALE);  
           }  
           else MessageDialog("Wavefront Import Plug Not Found!");  
        
           GePrint("Scaling: "+RealToString(scaling));  
      

      I never get the MessageDialog. So, what is wrong here?

      Thanks,

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 25/04/2005 at 15:30, xxxxxxxx wrote:

        Anybody?

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          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...

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            On 26/04/2005 at 02:16, xxxxxxxx wrote:

            @kuroyume
            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?

            developer

            [Edit] havent seen mikaels posting before sending my answer, so maybe its only of little use, dont mind.

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

              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);  
              if (plug)  
              {  
              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.

              Fingers crossed... 🙂

              1 Reply Last reply Reply Quote 0
              • H Offline
                Helper
                last edited by

                THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                On 26/04/2005 at 10:17, xxxxxxxx wrote:

                Well, duh! 😉

                On a hunch, I tried something completely different (and no larch!).

                Try this:

                  
                #include "Fobjimport.h"  
                ...  
                // Get Wavefront Import Scale  
                BaseContainer* bc;  
                if (bc = GetWorldPluginData(FORMAT_OBJIMPORT))  
                {  
                     scaling = bc->GetReal(OBJIMPORTFILTER_SCALE);  
                }  
                else  
                {  
                     MessageDialog("Wavefront Import Data Not Retrieved!");  
                     return FALSE;  
                }  
                GePrint("Scaling: "+RealToString(scaling));  
                

                This works! Solved finally! 🙂

                Back to real work...

                1 Reply Last reply Reply Quote 0
                • H Offline
                  Helper
                  last edited by

                  THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                  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]

                  1 Reply Last reply Reply Quote 0
                  • H Offline
                    Helper
                    last edited by

                    THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                    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)" (?SetWorldPluginData@@YAHJAAVBaseContainer@@H@Z)  
                    ./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?

                    1 Reply Last reply Reply Quote 0
                    • H Offline
                      Helper
                      last edited by

                      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                      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.

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post