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

    Creating Spheres

    SDK Help
    0
    31
    15.6k
    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
      Helper
      last edited by

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

      On 12/11/2009 at 12:14, xxxxxxxx wrote:

      I also notice that there is no doc->EndUndo() in UpdatePlanet() and no AddUndo()s either. Maybe you should comment out the doc->StartUndo() until it is needed.

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

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

        On 12/11/2009 at 15:53, xxxxxxxx wrote:

        Thanks Robert,,, I have decided that in the UpdatePlanet function I am going to use GetDown, GetNext, and GetFirstMaterial to reference the materials and objects in the scene.

        I am running in to one problem though...

        The GetFirstMaterial() function is derived from the BaseMaterial, but my materials are from the Material Class.. Is it possible to use GetFirstMaterial on materials from the Material class?

        ~Shawn

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

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

          On 12/11/2009 at 16:14, xxxxxxxx wrote:

          You should be able to up-cast the BaseMaterial* returned by GetFirstMaterial() to Material* without any issues. Just use a C cast (Material* ) or a C++ one static_cast_<_material*_>_

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

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

            On 12/11/2009 at 19:38, xxxxxxxx wrote:

            Could you give me a code snippet of how that would look?

            Thanks,

            ~Shawn

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

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

              On 12/11/2009 at 19:54, xxxxxxxx wrote:

              // supposing that we're looking for the surfaceMat   
              for (BaseMaterial* mat = doc->GetFirstMaterial(); mat; mat = mat->GetNext())   
              {   
                   if (mat->GetName() == "whatever")   
                   {   
                        surfaceMat = static_cast<Material*>(mat);   
                        break;   
                   }   
              }
              
              1 Reply Last reply Reply Quote 0
              • H
                Helper
                last edited by

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

                On 13/11/2009 at 06:49, xxxxxxxx wrote:

                great thanks Robert...

                Now I need to change the fresnel settings of the color channel on a material.    so I am trying to use

                atmosphereMat->SetParameter(MATERIAL_COLOR_SHADER,?,NULL);

                But i am not sure what to put in the ? part....     or do I need to use a different constant other than MATERIAL_COLOR_SHADER?

                ~Shawn

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

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

                  On 13/11/2009 at 15:48, xxxxxxxx wrote:

                  I would expect that you should be able to get away with:

                  atmosphereMat->SetParameter(MATERIAL_COLOR_SHADER,GeData(shader),NULL);

                  where shader is a pointer to the shader being added to the SHADERLINK.

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

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

                    On 13/11/2009 at 15:53, xxxxxxxx wrote:

                    so would that shader be (Xfresnel) ?

                    ~Shawn

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

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

                      On 13/11/2009 at 16:01, xxxxxxxx wrote:

                      This is what I tried.. and I still get nothing in the TEXTURE field of the Color Channel.

                      atmosphereMat->SetParameter(MATERIAL_COLOR_SHADER,GeData(Xfresnel),NULL);

                      Any other thoughts?

                      Thanks a lot for your help. 🙂

                      ~Shawn

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

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

                        On 13/11/2009 at 16:04, xxxxxxxx wrote:

                        No, I think it will need to be an actual allocated shader:

                        PluginShader* shader = PluginShader::Alloc(Xfresnel);

                        Also, there is another way from c4d_basechannel using HandleShaderPopup(). No experience with it though.

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

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

                          On 13/11/2009 at 16:08, xxxxxxxx wrote:

                          I will try it out and let you know.

                          Thanks again Robert.

                          ~Shawn

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

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

                            On 13/11/2009 at 16:14, xxxxxxxx wrote:

                            declared with ...

                            PluginShader* fresnel = PluginShader::Alloc(Xfresnel);

                            then used ...

                            atmosphereMat->SetParameter(MATERIAL_COLOR_SHADER,GeData(fresnel),NULL);

                            and got this error..

                            c:\users he fosters\desktop\cinema4dr11010\plugins\#planet\source\object\planet.cpp(318) : error C2440: '<function-style-cast>' : cannot convert from 'PluginShader *' to 'GeData'
                            2>        No constructor could take the source type, or constructor overload resolution was ambiguous

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

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

                              On 13/11/2009 at 16:53, xxxxxxxx wrote:

                              You might want to try going through the BaseContainer then:

                              atmosphereMat->GetDataInstance()->SetLink(MATERIAL_COLOR_SHADER, fresnel);

                              GeData() can't handle general pointers (only BaseLink* ).

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

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

                                On 13/11/2009 at 17:11, xxxxxxxx wrote:

                                hmmm... well it comiles fine but still nothing shows up in the texture field.... that stinks.

                                ~Shawn

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

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

                                  On 13/11/2009 at 17:49, xxxxxxxx wrote:

                                  I think you may be stuck with HandleShaderPopup() then. I couldn't find anything here, in the docs, or in the cinema4dsdk that describes how to set a channel shader.

                                  It is also possible that you need to insert the shader into the material:

                                  atmosphereMat->InsertShader(fresnel, NULL);

                                  Then try to set the link. Again, I don't see any examples or more explicit information on this.

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

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

                                    On 13/11/2009 at 17:53, xxxxxxxx wrote:

                                    atmosphereMat->InsertShader(fresnel, NULL);

                                    that worked,,    WOO HOO!    Now I jus tneed to figure out how to change the colors in the shader..   LOL...

                                    Thanks a million Robert.

                                    ~Shawn

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

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

                                      On 13/11/2009 at 19:54, xxxxxxxx wrote:

                                      LOL.. okay so after a few hours of searching a trying, I am at somewhat of a loss again..   How would I change the color of the knots that are in the fresnel shader?

                                      ~Shawn

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

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

                                        On 13/11/2009 at 20:38, xxxxxxxx wrote:

                                        Here's what I have so far..   This inserts the fresnel shader in to the material for both the color channel and the transparency channel.   And with the current code it completely removes the color knots from the gradient in both fresnel shaders. So I feel like I'm on the right track.. any help would be greatly appreciated. 🙂

                                          
                                                  atmosphereMat->InsertShader(fresnelColor, NULL);   
                                                  atmosphereMat->InsertShader(fresnelTrans, NULL);   
                                                  atmosphereMat->GetDataInstance()->SetLink(MATERIAL_COLOR_SHADER, fresnelColor);   
                                                  atmosphereMat->GetDataInstance()->SetLink(MATERIAL_TRANSPARENCY_SHADER, fresnelTrans);   
                                                  fresnelColor->SetParameter(SLA_FRESNEL_GRADIENT,ATMOSPHERIC_COLOR, 0);   
                                                  fresnelTrans->SetParameter(SLA_FRESNEL_GRADIENT,Vector (0,0,0), 1);   
                                          
                                        
                                        1 Reply Last reply Reply Quote 0
                                        • H
                                          Helper
                                          last edited by

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

                                          On 15/11/2009 at 07:25, xxxxxxxx wrote:

                                          Does anyone know how I would add color knots to the gradient in the fresnel shader that I have added with the above code?

                                          Thanks,

                                          ~Shawn

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