Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Natvis settings not working?

    Cinema 4D SDK
    windows c++
    3
    5
    790
    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.
    • E
      ECHekman
      last edited by

      Im trying to get the natvis files to work, and I added the settings from the documentation.
      However this does not seem to do anything. Is there something im missing?

      AdditionalSolutionFiles=\
      ..\..\frameworks\core.framework\project\typeviewer\msvc\maxon.natvis;\
      ..\..\frameworks\cinema.framework\project\typeviewer\msvc\c4dapi.natvis
      

      I have gotten it to work by manually adding the natvis to the visual studio document folder, but i would like to automate it.

      ferdinandF 1 Reply Last reply Reply Quote 0
      • ferdinandF
        ferdinand @ECHekman
        last edited by ferdinand

        Hey @ECHekman,

        Thank you for reaching out to us. Your question is a bit ambiguous since you neither tell us where you put the snippet you show us and what your project structure is, nor what constitutes for you as 'does not seem to do anything'.

        AdditionalSolutionFiles is a command that only works in solution definitions (the docs could admittedly be a bit more verbose about this) or in non-public project types such as app. E.g., for sdk\plugins\project\projectdefinition.txt, the solution definition of the C++ SDK, the following definition:

        // The platforms this solution is targeting - can be [Win64;OSX;Linux].
        Platform=Win64;OSX;Linux
        
        // The type of this definition.
        Type=Solution
        
        // The /projects/plugins/ projects that are part of this solution. Each of them will be compiled into its own
        // binary and corresponds to a folder in /plugins/, each with its own projectdefinition.txt file.
        Solution=\
        	plugins/example.main;\
        	plugins/example.migration_2024;\
        	plugins/example.assets;\
        	plugins/example.nodes;\
        	plugins/example.image
        
        // The files we want to add to the solution, there is AFAIK no way to do this on a project level for things
        // that are neither binary nor source code libraries.
        AdditionalSolutionFiles=\
          ..\..\frameworks\core.framework\project\typeviewer\msvc\maxon.natvis;\
          ..\..\frameworks\cinema.framework\project\typeviewer\msvc\c4dapi.natvis;
        

        Will result in this:
        7abd93fd-bd8c-4576-acd0-9a785d615ebf-image.png

        Which I would consider working just fine, or does this not do what you want? I would want to also point out here out that the project tool is deprecated tech. We will move away from it quite soon, so we will not be adding new features to it anymore.

        Cheers,
        Ferdinand

        MAXON SDK Specialist
        developers.maxon.net

        1 Reply Last reply Reply Quote 0
        • B
          bojidar
          last edited by bojidar

          Is maxon.natvis supposed to work for Node types e.g maxon::GraphNode, maxon::nodes::Node or did we miss something obvious? It seems they use some internal types which are not available and I ended up writing something similar to the pointer arithmetic in the python lldb script.

          ferdinandF 1 Reply Last reply Reply Quote 0
          • E
            ECHekman
            last edited by

            Thanks Ferdinand. Putting those lines in the projectdefinitions.txt of the solution was the... solution 😉

            1 Reply Last reply Reply Quote 1
            • ferdinandF
              ferdinand @bojidar
              last edited by ferdinand

              Hey @bojidar,

              well, we do not write these object views (the natvis for MSVC and the Python scripts for Xcode) for public usage but for internal usage. That we hand them out to third parties is just a courtesy. When we are looking at maxon::GraphNode,

              <Type Name="maxon::GraphNode">
                	<DisplayString Condition="_mem[0] != 0">{((maxon::NodePath*)&amp;_mem[0]),na}</DisplayString>
                	<!-- Root will have empty path and valid graph -->
                  <DisplayString Condition="_mem[0] == 0 &amp;&amp; _graph._object != 0">Root</DisplayString>
                  <DisplayString Condition="_mem[0] == 0">nullptr</DisplayString>
                  <Expand>
                    <Item Name="Path">(((maxon::NodePath*)&amp;_mem[0])),na</Item>
                    <Item Name="Kind" Condition="_mem[0] != 0 &amp;&amp; _graph._object != 0">(maxon::NODE_KIND)((((nodes.module.xdl64!maxon::nodes::NodePathImpl::CountAndKind*) &amp; (*(nodes.module.xdl64!maxon::nodes::NodePathImpl**) &amp; _mem[0])->_path))->kind &amp; 0xFF)</Item>
                    <Item Name="Kind" Condition="_mem[0] == 0 &amp;&amp; _graph._object != 0">maxon::NODE_KIND::NONE</Item>
                    <Item Name="Info">((nodes.module.xdl64!maxon::nodes::NodesGraphModelImpl::Info*)this->_mem),na</Item>
                    <Item Name="Graph">(this->_graph)</Item>
                    <Item Name="Graph Storage">(this->_mem)</Item>
                  </Expand>
              </Type>
              

              then there are indeed quite a few references to the implementation (which means that this cannot work in the public API). You could rip these out to make it work, but would then be left with only a small subset of the debug attributes. But that would be up to you.

              In general, you can expect the Cinema API to be more conservative and almost all object views working there, while the Maxon API is generally more internal in nature.

              Cheers,
              Ferdinand

              MAXON SDK Specialist
              developers.maxon.net

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