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
    • Login

    Import with Melange 5 / Get Normals (from 11.5)

    Scheduled Pinned Locked Moved SDK Help
    5 Posts 0 Posters 446 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 14/10/2011 at 05:09, xxxxxxxx wrote:

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

      ---------
      Hey!

      I'm writing an importer  for an external tool that should support C4D. while i'm getting all kind of data smoothly, i have some troubles with the normal tag. It doesn't seem that 11.5 attaches normal tags. So do i have to create them on my own based on neighbours, edges and phong break angles? Is there any other way?

      i unfortunately never touched C4D before, and it's my first day with the SDK.... but i can't find the info i'm needing 😞

      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 14/10/2011 at 05:43, xxxxxxxx wrote:

        Nevermind, i found that it works fine with:

        SVector* normals = op->CreatePhongNormals();

        The question is, is it safe to rely on that?

        Otherwise i'd fallback and generate it with the method mentioned above.

        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 14/10/2011 at 06:33, xxxxxxxx wrote:

          CreatePhongNormals will give you the exeact same vertex normals that Cinema uses. Just make sure the object contain a Phong tag, otherwise the function will crash.

          cheers,
          Matthias

          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 20/10/2011 at 00:43, xxxxxxxx wrote:

            Originally posted by xxxxxxxx

            CreatePhongNormals will give you the exeact same vertex normals that Cinema uses. Just make sure the object contain a Phong tag, otherwise the function will crash.cheers,Matthias

            I think it won't actually crash, but it returns a Null pointer (which would crash if you didn't check the return before using it) - at least that was my experience in the past.

            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 20/10/2011 at 06:30, xxxxxxxx wrote:

              Hmm, sorry to open this again. But the normals i'm getting from CreatePhongNormals seem to be false, or i'm adressing them wrong, probably. when rendering/displaying the normals, they look totally different and i can't find a reasonable pattern what i'm adressing wrong here.

              Here's what i do:

                
                const Vector *vertices            = op->GetPointR();  
                const CPolygon *polygonIndices    = op->GetPolygonR();  
                LONG polygonCount                = op->GetPolygonCount();  
                
              if(btag->GetType() == Tphong)  
              {  
                normals = op->CreatePhongNormals();  
              }  
                
              for(long i = 0; i < polygonCount; i++)  
              {  
                // add data, e.g.:  
                vertices[polygonIndices[i].c], normals[i * 4 + 2], uvw.c  
                vertices[polygonIndices[i].b], normals[i * 4 + 1], uvw.b  
              }  
                
              

              any idea?

              thanks for your help! awesome 🙂

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