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

    PySide2 for Python 2.7 Windows Version?

    General Talk
    r21 python
    7
    15
    3.3k
    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.
    • B
      bentraje
      last edited by

      Hi,

      Have anyone tried using PySide2 for C4D?
      Just wondering if you have the PySide2 for Python 2.7 Windows Version, which will for C4D R21 and below.

      The official repository only have Linux and Mac versions
      https://pypi.org/project/PySide2/5.12.0/#files

      Regards,
      Ben

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

        Hi,

        there are of course also Windows versions of Qt and its official Python bindings, just look into your link.

        The problem is that pyside2 requires pip to be installed in its recommended way like most of Python's 3rd party libraries these days. Cinema's Python does not have the pip tool and package included. This in turn will make it quite hard, if not impossible, to install pyside2 on c4dpy, because you would have to handle all the dependencies and setup procedures that are embedded within the pyside2 wheel (the installation file).

        If I was hellbent on using an external GUI, I would probably look into tkinter, Python's default GUI. tkinter however, has also been removed from c4dpy. So you would have to (manually) reinstall this one too, but you would probably have a better time trying to, because tkinter has no external dependencies except the binaries it comes with, i.e. is less complex than pyside2.

        I think Maxon said at some point, that they did remove tkinter, because they wanted to disencourage the usage of GUI frameworks other than their own. You can make of that statement what you want, but I want to stress, that there is no guarantee that it is technically possible to get tkinter running on c4dpy. Or in other words: It might not only have been a strategic decision to remove that package, but also a technical one.

        Cheers,
        zipit

        MAXON SDK Specialist
        developers.maxon.net

        1 Reply Last reply Reply Quote 1
        • B
          bentraje
          last edited by

          @zipit

          Thanks for the response! Yea, I guess there is no way around it unless its officially supported.
          Just got off on a Maya job and discovered PySide2 and it was joy to work with. I can use the QtDesigner to build the layout and just focus more on the backend tasks.

          1 Reply Last reply Reply Quote 0
          • ManuelM
            Manuel
            last edited by

            hi,

            @zipit said everything 🙂

            I'm agree with you, creating UI is time consuming and we know that any tool to help in that direction would be really appreciate.

            Cheers,
            Manuel

            MAXON SDK Specialist

            MAXON Registered Developer

            1 Reply Last reply Reply Quote 1
            • B
              bentraje
              last edited by

              @m_magalhaes

              Thanks for the response. Here's hoping that PySide2 gets supported on later version.

              1 Reply Last reply Reply Quote 0
              • I
                iluxa7k
                last edited by

                Hello
                Trolltech officially does not support pyside2 for py27 Win.

                raw test of
                pyside2.png

                P 1 Reply Last reply Reply Quote 0
                • P
                  ph1lh00k @iluxa7k
                  last edited by

                  Hi @iluxa7k

                  I see you managed to get PySide2 working in C4D... I'm struggling to get it working - could you provide a little info on how you managed it?

                  Thanks,
                  Phil

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

                    Hi @ph1lh00k,

                    what is your approach to installing it? Are you using pip and on which OS are you? pip is still not delivered with Cinema's Python, but now supported in R23 (but for macOS it is broken at the moment). To install it, you have to first download get-pip.py and then run it with c4dpy and the command line (make sure to have admin rights in the app):

                    cd c:\program files\maxon\R23 # or where ever your cinema r23 is sitting
                    c:\Program Files\Maxon\R23>c4dpy %USERPROFILE%\Desktop\get-pip.py # assuming you saved get-pip to your desktop
                    

                    then you can install via pip pySide, which gave me the following output.

                    c:\Program Files\Maxon\R23>c4dpy -m pip install `PySide2`
                    T
                    Collecting PySide2
                      Downloading PySide2-5.15.2-5.15.2-cp35.cp36.cp37.cp38.cp39-none-win_amd64.whl (136.3 MB)
                         |â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^| 136.3 MB 6.4 MB/s
                    Collecting shiboken2==5.15.2
                      Downloading shiboken2-5.15.2-5.15.2-cp35.cp36.cp37.cp38.cp39-none-win_amd64.whl (2.3 MB)
                         |â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^â-^| 2.3 MB 6.4 MB/s
                    Installing collected packages: shiboken2, PySide2
                      WARNING: The scripts pyside2-designer.exe, pyside2-lupdate.exe, pyside2-rcc.exe and pyside2-uic.exe are installed in 'c:\Program Files\Maxon\R23\resource\modules\python\libs\python37.win64.framework\Scripts' which is not on PATH.
                      Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
                    Successfully installed PySide2-5.15.2 shiboken2-5.15.2
                    

                    Which is somewhat what I expected to happen, due to c4dpy not being on PATH and also deviating from the python.exe signature. You can try to duct-tape this into place, but PySide2 is not supported by us, so you are unfortunately on your own here.

                    Cheers,
                    Ferdinand

                    MAXON SDK Specialist
                    developers.maxon.net

                    1 Reply Last reply Reply Quote 0
                    • M
                      m_adam
                      last edited by

                      Just to add some extra information, but PySide being a Qt port, this is not 100% supported by Cinema 4D (while you can make it working) Qt may interfere with the usual Cinema 4D interface and you will need to find Cinema 4D specifics workaround for doing usual Qt things.

                      So I just warn you Qt is not officially supported by Cinema 4D.

                      Cheers,
                      Maxime.

                      MAXON SDK Specialist

                      Development Blog, MAXON Registered Developer

                      1 Reply Last reply Reply Quote 0
                      • P
                        ph1lh00k
                        last edited by

                        Thanks @ferdinand @m_adam ,

                        I was hoping it would be straight forward as I have an existing tool built in PySide2 that I need to port to C4D... Guess I'll just have to build from scratch using the c4d GUI module. ={

                        Thanks,
                        Phil

                        1 Reply Last reply Reply Quote 0
                        • I
                          iluxa7k @ph1lh00k
                          last edited by

                          @ph1lh00k said in PySide2 for Python 2.7 Windows Version?:

                          Hi @iluxa7k

                          I see you managed to get PySide2 working in C4D... I'm struggling to get it working - could you provide a little info on how you managed it?

                          Thanks,
                          Phil

                          Hello Phil
                          Currently i stopped using of cinema4d, switch to flexible Blender. Remove any data for c4d content.

                          For that case, i implemented injection-methods code from several topics at autodesk's beta forum for 3dsmax. That's all

                          1 Reply Last reply Reply Quote 0
                          • U
                            UnderArmor6555 @bentraje
                            last edited by

                            @iluxa7k
                            Hey @iluxa7k ,

                            You mind giving us more info on how you achieved PySide2 within C4D R22 and under? I've tried, many methods, but I keep getting "DLL load failed". At this point, I'm hoping to pay someone to figure this out for us.

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

                              Hello @bentraje,

                              without any further questions, we will consider this posting as solved by Wednesday and flag it accordingly.

                              Cheers,
                              Ferdinand

                              MAXON SDK Specialist
                              developers.maxon.net

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

                                Hi @ferdinand

                                Sorry for the late response. Sure sure. Let's close this thread.

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

                                  Hello @bentraje,

                                  no need to be sorry and thanks for closing it 🙂

                                  Cheers,
                                  Ferdinand

                                  MAXON SDK Specialist
                                  developers.maxon.net

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