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

    9.5 + GetFirstMaterial?

    Scheduled Pinned Locked Moved SDK Help
    4 Posts 0 Posters 352 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 21/11/2005 at 15:51, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   9.5 
      Platform:   Windows  ; Mac  ;  Mac OSX  ; 
      Language(s) :     C++  ;

      ---------
      I am having a problem with GetFirstMaterial with 9.5.
      I broke my code down to the simplest form:

        
      BaseDocument* doc = LoadDocument(fn,FALSE,NULL);  
      if (!doc) return FALSE;  
      BaseMaterial* mat = doc->GetFirstMaterial();  
      

      and mat is always NULL.
      The debugger reports the value for mat\BaseList2D "CXX0030: Error: expression cannot be evaluated"

      fn is a valid filename and does contain materials.

      I am using vc6.

      Is this a problem with 9.5 or am I missing a step or something?

      -Chris

      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 22/11/2005 at 02:14, xxxxxxxx wrote:

        The correct sintax is:_<_h4_>_

        BaseDocument* LoadDocument(const Filename& name, LONG loadflags, BaseThread* thre_<_h4_>_H4>

        Similar "LoadFile" but this time the document isn't put into the editors list of documents and you have control over the document_<_h5_>_> _<_h5_>_eturn
        > BaseDocument*
        >
        >> Document that was loaded, or NULL if it failed.
        >
        > <_<_h5_>_CKQUOTE>
        >
        > ##### _<_h5_>_rameters_
        >
        >> const Filename & name
        >>
        >>> File to load the document from.
        >>
        >> LONG loadflags
        >>
        >>> Flags for the loader:
        >
        >>>
        >>>> Constant | Description
        >>>> ---|---
        >>>>
        >>>>

        \>>>>     
        \>>>>     
        \>>>>     SCENEFILTER_OBJECTS
        \>>>> 
        \>>>> 
        

        >>>>
        >>>> |
        >>>>
        >>>> Load/save only the objects and associated items, such as materials used.
        >>>>
        >>>>

        \>>>>     
        \>>>>     
        \>>>>     SCENEFILTER_MATERIALS
        \>>>> 
        \>>>> 
        

        >>>>
        >>>> |
        >>>>
        >>>> Load/save only the materials.
        >>>>
        >>>>

        \>>>>     
        \>>>>     
        \>>>>     SCENEFILTER_DIALOGSALLOWED
        \>>>> 
        \>>>> 
        

        >>>>
        >>>> |
        >>>>
        >>>> Flag to inform your plugin that a dialog can be displayed if you wish, if this flag not set then no dialogs must be opened.
        >>>>
        >>>>

        \>>>>     
        \>>>>     
        \>>>>     SCENEFILTER_PROGRESSALLOWED
        \>>>> 
        \>>>> 
        

        >>>>
        >>>> |
        >>>>
        >>>> Flag to inform your plugin that a progress bar can be displayed if you wish. The progress bar can be set by calling StatusSetBar.
        >>>>
        >>>>

        \>>>>     
        \>>>>     
        \>>>>     SCENEFILTER_MERGESCENE
        \>>>> 
        \>>>> 
        

        >>>>
        >>>> |
        >>>>
        >>>> Flag to inform your plugin that this is a merge operation, i.e. that the document you're inserting to is an existing scene.
        >>>
        >>>
        >
        >>
        >> BaseThread* thread
        >>
        >>> The current thread, or NULL for the main CINEMA 4D thread. The caller owns the pointed object.
        >>>
        >>> I think that u miss or put correctly flags & threads.
        >>>
        >>> Bye

        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 22/11/2005 at 02:40, xxxxxxxx wrote:

          Unlike older versions without this argument, the loadflags look to be necessary. Have you tried SCENEFILTER_OBJECTS or SCENEFILTER_MATERIALS for the loadflags argument?

          As I'm supporting older versions with older SDKs, I hadn't noticed this change (new to R9.5 for sure!).

          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 22/11/2005 at 05:46, xxxxxxxx wrote:

            LOL
            I can't tell you how many times I looked over LoadDocument in the 9.5 sdk docs and never realized that "Bool show_error" had been replaced with "LONG loadflags".

            Thanks guys. It's working now.

            -Chris

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