Navigation

    • Register
    • Login
    • Search
    • Categories
    1. Home
    2. merkvilson
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    merkvilson

    @merkvilson

    5
    Reputation
    97
    Posts
    434
    Profile views
    6
    Followers
    0
    Following
    Joined Last Online
    Email g.merkvilson@gmail.com

    merkvilson Follow

    Posts made by merkvilson

    • RE: urllib2.HTTPError: HTTP Error 403

      Code:

      import c4d, urllib2, os
      
      url = r"https://www.patreon.com/posts/24993001"
      
      f = os.path.join(os.path.dirname(c4d.storage.GeGetStartupApplication()), "resource", "ssl", "cacert.pem")
      
      urllib2.urlopen(url, cafile=f)
      

      Error:

      Traceback (most recent call last):
        File "scriptmanager", line 7, in <module>
        File "C:\Program Files\MAXON\Cinema 4D R20 Demo\resource\modules\python\libs\win64\python27.vs2008.framework\lib\urllib2.py", line 154, in urlopen
          return opener.open(url, data, timeout)
        File "C:\Program Files\MAXON\Cinema 4D R20 Demo\resource\modules\python\libs\win64\python27.vs2008.framework\lib\urllib2.py", line 435, in open
          response = meth(req, response)
        File "C:\Program Files\MAXON\Cinema 4D R20 Demo\resource\modules\python\libs\win64\python27.vs2008.framework\lib\urllib2.py", line 548, in http_response
          'http', request, response, code, msg, hdrs)
        File "C:\Program Files\MAXON\Cinema 4D R20 Demo\resource\modules\python\libs\win64\python27.vs2008.framework\lib\urllib2.py", line 473, in error
          return self._call_chain(*args)
        File "C:\Program Files\MAXON\Cinema 4D R20 Demo\resource\modules\python\libs\win64\python27.vs2008.framework\lib\urllib2.py", line 407, in _call_chain
          result = func(*args)
        File "C:\Program Files\MAXON\Cinema 4D R20 Demo\resource\modules\python\libs\win64\python27.vs2008.framework\lib\urllib2.py", line 556, in http_error_default
          raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
      urllib2.HTTPError: HTTP Error 403: Forbidden
      
      posted in Cinema 4D Development
      merkvilson
    • urllib2.HTTPError: HTTP Error 403

      urllib2 no longer has any effect in Cinema 4D.
      It is worth mentioning that I did not change anything in my code. It was working like a charm.
      I doubt the latest windows update corrupted it.
      Are there any solutions to bypass this limitation?

      Traceback (most recent call last):
        File "C:\Users\Merk\Documents\GIT Projects\c4d_plugins\Symex\symex.pyp", line 74, in <module>
          check.UpdateAtStartUp(version, url, command = 1051407,)
        File "C:\Users\Merk\Documents\GIT Projects\c4d_plugins\Symex\res\modules\checkUpdate.py", line 171, in UpdateAtStartUp
          if NewVersion(version, url,)[0]:
        File "C:\Users\Merk\Documents\GIT Projects\c4d_plugins\Symex\res\modules\checkUpdate.py", line 68, in NewVersion
          htmlsource = urllib2.urlopen(url, cafile=f)
        File "C:\Program Files\MAXON\Cinema 4D R20\resource\modules\python\libs\win64\python27.vs2008.framework\lib\urllib2.py", line 154, in urlopen
          return opener.open(url, data, timeout)
        File "C:\Program Files\MAXON\Cinema 4D R20\resource\modules\python\libs\win64\python27.vs2008.framework\lib\urllib2.py", line 435, in open
          response = meth(req, response)
        File "C:\Program Files\MAXON\Cinema 4D R20\resource\modules\python\libs\win64\python27.vs2008.framework\lib\urllib2.py", line 548, in http_response
          'http', request, response, code, msg, hdrs)
        File "C:\Program Files\MAXON\Cinema 4D R20\resource\modules\python\libs\win64\python27.vs2008.framework\lib\urllib2.py", line 473, in error
          return self._call_chain(*args)
        File "C:\Program Files\MAXON\Cinema 4D R20\resource\modules\python\libs\win64\python27.vs2008.framework\lib\urllib2.py", line 407, in _call_chain
          result = func(*args)
        File "C:\Program Files\MAXON\Cinema 4D R20\resource\modules\python\libs\win64\python27.vs2008.framework\lib\urllib2.py", line 556, in http_error_default
          raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
      urllib2.HTTPError: HTTP Error 403: Forbidden
      
      posted in Cinema 4D Development
      merkvilson
    • RE: DrawMultipleHUDText issue

      OK. Now I get it. 👌

      Thank you very much! I really appreciate what you've done. 😁

      Have a good day! 💙

      -Merk

      posted in Cinema 4D Development
      merkvilson
    • RE: DrawMultipleHUDText issue

      OMG! You just wrote the entire plugin for my silly question. 😱
      Thank You!!! 💙

      I have only one question.
      Why did you use
      Draw(self, op, drawpass, bd, bh)
      instead of
      Draw(self, tag, op, bd, bh)
      will not drawpass be treated as op and op as a tag?

      posted in Cinema 4D Development
      merkvilson
    • RE: DrawMultipleHUDText issue

      The method above causes shading problems which can be solved by enabling depth option. bd.SetDepth(True)

      But it's still displayed on the background. Is it possible to bring it to the front?

      posted in Cinema 4D Development
      merkvilson
    • RE: DrawMultipleHUDText issue

      Seems like I figured this out but it's kinda complicated.

          def Draw(self, tag, op, bd, bh):
      
              values0 = [{'_txt': "Hello", "_position": v(100,100,0)},{'_txt': "World", "_position": v(200,200,0)}]
      
              bd.DrawMultipleHUDText(values0)
      
              return c4d.DRAWRESULT_OK
      
      posted in Cinema 4D Development
      merkvilson
    • RE: DrawMultipleHUDText issue

      I want to display these values on top of other viewport elements.

      posted in Cinema 4D Development
      merkvilson
    • DrawMultipleHUDText issue

      Hello PluginCafe! :)

      I'm using Draw() method if TagData plugin for displaying multiple text values but I can't figure out, how the DrawMultipleHUDText works.

      Let's assume I have a list of strings
      abc = [ "Hello", "World", ]

      And a list of vectors (Usually I'm importing c4d.Vector as v)
      xyz = [v(0,100,0), v(0,200,0)]

      How should I pass them into DrawMultipleHUDText?

      I tried this method and it does not work.

          def Draw(self, tag, op, bd, bh):
      
              abc = ["Hello", "World"]
              xyz = [v(0, 100, 0), v(0, 200, 0)]
      
              values = {'_txt': abc, "_position": xyz}
      
              bd.DrawMultipleHUDText(values)
      
      
              return c4d.DRAWRESULT_OK
      
      posted in Cinema 4D Development
      merkvilson
    • RE: merge BaceCointainer from one object to another.

      Thanks, Manuel! :)

      Don't spend more time on this. I already know about "brute force" methods, so I probably will use it in my code.

      I'm making a free, open-source spline object plugin which will contain spline object properties.

      Its Angle, Number, and Maximum Length values are ghosted according to the Interpolation Points value. I do not want to mislead people and use complicated snippets in my code, but if this is the only way, then I will INCLUDE spline data in the .res file which can be ghosted directly from .pyp file via GetDEnabling

          def GetDEnabling(self, node, id, t_data, flags, itemdesc):
      
              spline_type = node[c4d.SPLINEOBJECT_INTERPOLATION]
      
              if   spline_type == 0: ghost1,ghost2,ghost3 = False, False, False
              elif spline_type == 1: ghost1,ghost2,ghost3 = True , False, False
              elif spline_type == 2: ghost1,ghost2,ghost3 = True , False, False
              elif spline_type == 3: ghost1,ghost2,ghost3 = False, True , False
              elif spline_type == 4: ghost1,ghost2,ghost3 = False, True , True
      
              if id[0].id == c4d.SPLINEOBJECT_SUB:            return ghost1
              if id[0].id == c4d.SPLINEOBJECT_ANGLE:          return ghost2
              if id[0].id == c4d.SPLINEOBJECT_MAXIMUMLENGTH:  return ghost3
      
              return True
      
      posted in Cinema 4D Development
      merkvilson
    • RE: merge BaceCointainer from one object to another.

      It is worth mentioning that I know how to INCLUDE desc data from other objects via .res file but with this method, I will have to manually define cases in which, parameters will be ghosted.

      posted in Cinema 4D Development
      merkvilson