Plugin Cafe Homepage
Forum Home Forum Home > Plugin Cafe > PYTHON Development
  New Posts New Posts
  FAQ FAQ  Forum Search

Change of Python Integration

Author
Message
  Topic Search Topic Search
Andreas Block View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2014 Oct 01
Location: Hannover
Online Status: Offline
Posts: 1878
Direct Link To This Post Topic: Change of Python Integration
    Posted: 2015 Jul 15 at 5:27am
With the next major version Cinema 4D R17 (SP1 to be precise) we will move from Python 2.6.4 to Python 2.7.9.
From then on Python 2.6.4 will not be used anymore.

The reason for this decision were minor issues in Python 2.6 and increased compatibility with other 3D packages.

In most cases this change should be no problem. Tests with existing scripts/plugins showed, almost
all scripts, plugins, etc. are compatible with Python 2.7. Only in very rare cases adjustments need to be made.

Note for Custom compiled Python C-modules:
If a plugin is based on a Python C-module, this module needs to be recompiled. Latest Xcode version and Visual Studio 2012 SP4 should be used for this.

Cheers,
Andreas
SDK Support Engineer
Back to Top
NiklasR View Drop Down
Member
Member


Joined: 2010 Dec 13
Location: Germany
Online Status: Offline
Posts: 2575
Direct Link To This Post Posted: 2015 Jul 15 at 5:56am
Same goes for byte-compiled Python code. You can do something like this

if sys.version.startswith('2.7'):
  module_path = 'res/modules_27'
else
  module_path = 'res/modules_26'

with _localimport(module_path):
  import module_a
  import module_b

More info on Third Party Modules in Plugins can be found here.
Back to Top
Ilya View Drop Down
Member
Member
Avatar

Joined: 2009 Nov 04
Location: Russia
Online Status: Offline
Posts: 245
Direct Link To This Post Posted: 2015 Aug 31 at 10:06pm
Hello

I test several cython and with numpy/scipy plugins

got errors with finding of Python.h and etc. Dead

Who moved headers from:
resource\modules\python\Python.win64.framework\include
to:
resource\modules\python\Python.win64.framework\include\python27

and why? Wink

p.s. libs same, resource\modules\python\Python.win64.framework\libs\


Edited by Ilya - 2015 Sep 01 at 12:01am
(sorry for my English)
Back to Top
Yannick Puech View Drop Down
Forum Moderator
Forum Moderator


Joined: 2011 Apr 13
Location: Spain
Online Status: Offline
Posts: 1143
Direct Link To This Post Posted: 2015 Sep 01 at 1:11am
Hi,

Originally posted by Ilya


I test several cython and with numpy/scipy plugins

got errors with finding of Python.h and etc. Dead

Who moved headers from:
resource\modules\python\Python.win64.framework\include
to:
resource\modules\python\Python.win64.framework\include\python27

and why? Wink

p.s. libs same, resource\modules\python\Python.win64.framework\libs\
We're sorry we didn't revealed that the python includes are now in a "python27" subfolder in R17.
But this isn't a big issue. The paths can be changed in your project and that fix it.


MAXON
Developer Support
Back to Top
Ilya View Drop Down
Member
Member
Avatar

Joined: 2009 Nov 04
Location: Russia
Online Status: Offline
Posts: 245
Direct Link To This Post Posted: 2015 Sep 01 at 1:27am
Thanks.
I caught it when installing of scipy wheel. I copy headers.
I thought it will be something new... probably methods to switch between different versions of python.

P.s.
We're sorry we didn't revealed that the python includes are now in a "python27" subfolder in R17.

Yannick
Does it fit to standards of python distribution?
for example to install cython or py modules like in install packages


Edited by Ilya - 2015 Sep 01 at 1:35am
(sorry for my English)
Back to Top
Ilya View Drop Down
Member
Member
Avatar

Joined: 2009 Nov 04
Location: Russia
Online Status: Offline
Posts: 245
Direct Link To This Post Posted: 2015 Sep 08 at 5:10am
Hello
Me again.
I wanna say thanks a'lot to teams for new python core!ClapBeer
I'm glad as little child! Sorry for such expression of feelings!

Primitive test


(sorry for my English)
Back to Top
s_rath View Drop Down
Member
Member


Joined: 2010 May 04
Location: Ne / Düsseldorf
Online Status: Offline
Posts: 319
Direct Link To This Post Posted: 2015 Sep 08 at 5:20am
Great job! Nice to see it's working.
Btw, the headers were moved to python2.7 so includes are now more future proove.

#include "python27/Python.h"


Edited by s_rath - 2015 Sep 08 at 5:22am
http://www.twitter.com/_s_rath
Back to Top
Ilya View Drop Down
Member
Member
Avatar

Joined: 2009 Nov 04
Location: Russia
Online Status: Offline
Posts: 245
Direct Link To This Post Posted: 2015 Sep 08 at 5:31am
Hello Sebastian. Thanks a'lot for hard job!
No-no, i simply modify FabricEngine\Samples\EDK\HelloWorld\test.py
adding c4d stuff and simplify node-operator(to string, without externals)

I rethink about Python.win64.framework, made another dir py27_vc11 as source for compilation of 3dparty stuff and use User-Dir python for store of 3dparties modules
or use mingw

(sorry for my English)
Back to Top
NiklasR View Drop Down
Member
Member


Joined: 2010 Dec 13
Location: Germany
Online Status: Offline
Posts: 2575
Direct Link To This Post Posted: 2015 Sep 08 at 5:40am
Very Cool Ilya! Will you share the Fabric Engine binaries?
Back to Top
Ilya View Drop Down
Member
Member
Avatar

Joined: 2009 Nov 04
Location: Russia
Online Status: Offline
Posts: 245
Direct Link To This Post Posted: 2015 Sep 08 at 5:47am
Originally posted by NiklasR

Very Cool Ilya! Will you share the Fabric Engine binaries?

Not cool. Wink I copy&paste
About binaries, i used native python modules which include in beta FB 2.0. I copy to user dir.
I think you can to ask Fabric team to beta-testing, at their site. http://fabricengine.com/get-fabric



Edited by Ilya - 2015 Sep 08 at 6:07am
(sorry for my English)
Back to Top
carlosa View Drop Down
Member
Member


Joined: 2014 Nov 12
Online Status: Offline
Posts: 3
Direct Link To This Post Posted: 2016 Oct 21 at 2:11pm
Is there a pyside binary that works with R17?
I'm guessing I'll have to compile this my self?
Back to Top
carlosa View Drop Down
Member
Member


Joined: 2014 Nov 12
Online Status: Offline
Posts: 3
Direct Link To This Post Posted: 2016 Oct 21 at 2:20pm
P.s i'm trying a pip install now... hope fully that works...
Back to Top

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.61 [Free Express Edition]
Copyright ©2001-2009 Web Wiz

This page was generated in 0.094 seconds.