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

    Basic PyGenerator plugin Please

    PYTHON Development
    0
    26
    18.9k
    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 14/10/2011 at 17:12, xxxxxxxx wrote:

      Thanks,
      Hm.
      I can use GetVirtualObjects() and I now get a visible object.
      If I create a BaseObject like Ocube it is recognized by ie a Cloner.
      How ever if a create a Osplineobject or SplineObject (and set
      it's points where I want them) I also get a visible object, -but-
      it is not seen as a spline by a Cloner or an AlignToSpline Tag.
      It -is- recognized by a SweepNurb.
      Running MakeEditable or CurrentStateToObject I do get the correct
      spline in return.

      ok, so looking at the Py_DoubleCircle example it does not
      use GetVirtualObjects() but GetContour() instead.
      And it is seen by Cloner etc.
      But what is it in that example that makes that happen?

      When I use my "functional" spline code I don't get any errors
      but no spline is generated. Doing MakeEditable I get
      a Null Object in return.

      What is it in GetContour that is important?
      My plugin is based on the Py example and all I do
      is create a simple spline with no settings at all,
      no Draw, Handles or anything.

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

        Oh, the reason why I'm trying the Object Plugin way
        is that the setup is running using the Python Generator Object
        and it has the same issue that a returned spline is not seen
        by Cloners, AlignToSpline etc.

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

          is it?
          put in PyGenerator and make editable

            
          import c4d  
          #Welcome to the world of Python  
            
          def main() :  
          ย  spl = c4d.SplineObject(2,0)  
          ย  spl.SetPoint(0,c4d.Vector(0.0))  
          ย  spl.SetPoint(1,c4d.Vector(0.0,1000.0,0.0,))  
          ย  spl.Message(c4d.MSG_UPDATE)  
          ย  return spl  
          
          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/10/2011 at 14:52, xxxxxxxx wrote:

            Hi Ilya.
            I need to have the PyGenerator seen as a spline by a Cloner etc.
            -without- making it editable the same way as a cube generated
            in the PyGenerator is seen by a Cloner.

            The PyDoubleCircle example manage that and I can't figure out why.

            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/10/2011 at 16:22, xxxxxxxx wrote:

              In C++. We need to use the " virtual SplineObject* GetContour() " method. As part of the class.
              If it's left out. The spline does not even draw.
              This does not seem to be the case in python.

              Per the C++ SDK. GetContour() is used for generating splines.
              AFAIK. It's not needed to generate other types of objects.

              This is just a wild guess.
              But it looks like the way the python version is ported from C++ is allowing us to generate splines in python without using GetContour(). Which might be a bad practice.
              My guess is that this is not theย  "proper"ย  way to build a spline generator.ย  And will cause things like the Align-to-Spline tag not to work with it.

              This is just a wild guess based on my experience with it in C++.

              -ScottA

              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 16/10/2011 at 02:56, xxxxxxxx wrote:

                Hello Lennart
                I try to put spl-pygen object, clonner draw it normally, without returning of base object(make editable) as described.

                At more complex code, pyGen was failed at drawing of object if it is in clonner/or mo-object.

                Also try Nux95's DrawApi helpers, thanks a'lot to Niklas!
                Niklas, can you make sample with DrawLines if it-s possible, i some ago apply at sample project...but lost it....

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

                  Maybe I need to be even more clear ๐Ÿ™‚

                  Make a PyGenerator generating a spline.
                  ie return c4d.BaseObject(c4d.Osplinecircle)

                  Then put the PyGenerator in a Cloner as Object source
                  does not allow me to clone stuff on the PyGenerator
                  as the Cloner does not see the PyGenerator as a spline.

                  Put the PyDoubleCircle in the Cloner instead as Object source
                  and I can clone.

                  The issue really comes down to that I can't see what in
                  the PyDoubleCircle example that makes it work.
                  (Other than it's using GetContour() )

                  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 16/10/2011 at 10:22, xxxxxxxx wrote:

                    seems it's not possible, if only add optionally new functions as presenting of PyGen like splineObj...like checkbox with GetContour dependecy

                    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 16/10/2011 at 18:42, xxxxxxxx wrote:

                      Update. I've actually got it working (as a plugin), stripping down the
                      PyDoubleCircle example bit by bit..
                      I'll post the barebone working code this week with a new question
                      as it became a new issue how handle updating it.
                      My guess it's about GetCache(), Get/SetDirty(), all new
                      territory for me.

                      Thanks till later!
                      Lennart

                      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 24/10/2011 at 07:59, xxxxxxxx wrote:

                        Hello
                        There is interesting and unstable(need to glue to matrix of obj) test

                        http://imageshack.us/photo/my-images/153/cstotest.jpg/

                        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 24/10/2011 at 09:04, xxxxxxxx wrote:

                          That's a good twist, adding the Cloner link via the script, nice.
                          Don't need to do the CSTO either really.

                          Cheers
                          Lennart

                          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 24/10/2011 at 09:18, xxxxxxxx wrote:

                            Don't need to do the CSTO either really.

                            You're right! Thanks a'lot.

                            I played with M.Zabiegly's pointcloud's sample(big thanks to his xpresso tutorials), trying to get cache from procedural objects(Lennart, i make same 3d fashion sample as you did) and try to apply same CSTO.

                            For CSTO and additional py-snippets i want to say Thanks to Sebastien, Niklas, Scott...

                            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 26/10/2011 at 08:40, xxxxxxxx wrote:

                              I have question is this function replicate GetContour() - BaseObject.GetRealSpline ?

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

                                Not really I'm afraid.
                                But I've come a long way linking Cloners, MoSplines etc
                                from within the plugin as per the example you show earlier.
                                This way basically any virtual object within the generator
                                can be picked.

                                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 18/11/2011 at 09:20, xxxxxxxx wrote:

                                  Originally posted by xxxxxxxx

                                  Also try Nux95's DrawApi helpers, thanks a'lot to Niklas!
                                  Niklas, can you make sample with DrawLines if it-s possible, i some ago apply at sample project...but lost it....

                                  I'm sorry, haven't ever read this post before. ๐Ÿ˜Š
                                  Can you explain more what 'ya need ?

                                  PS: My latest achievement in the DrawApi module. (Animations) ๐Ÿ˜‰
                                  http://www.screenr.com/mQLs

                                  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 19/11/2011 at 23:44, xxxxxxxx wrote:

                                    Hallo

                                    Can you explain more what 'ya need ?

                                    I mean your previous work as Python Draw Helper(sample with bd, draw polygon triangle with coloring)

                                    your GUI development is wonderful!!!!

                                    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 20/11/2011 at 02:20, xxxxxxxx wrote:

                                      Ah I thought you were talking about 2d GUI, thats why I postet the video.ย ๐Ÿ˜‚
                                      Thanks !

                                      And what was your problem, now ? ^^

                                      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 21/11/2011 at 10:51, xxxxxxxx wrote:

                                        thanks, i have not any, pass it ๐Ÿ˜‰ or return TRUE

                                        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 22/11/2011 at 03:59, xxxxxxxx wrote:

                                          Why not try the Py-DoubleCircle example from the Python SDK?

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

                                            Hi Jack. That's what I did. But the issue turned out to be the cache.
                                            As it only refresh itself internally and not from changes of external input.
                                            I started another thread about that but it's not totally solved other than the workarounds mentioned there (link from within the script/code)

                                            https://developers.maxon.net/forum/topic/6070/6249_getcontour-refresh-or-uncache-how

                                            Cheers
                                            Lennart

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