如何为3ds max Python开发设置visual studio 2017 [英] How to set up visual studio 2017 for 3ds max Python development

查看:196
本文介绍了如何为3ds max Python开发设置visual studio 2017的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试配置我的visual studio(2017)开发环境,因此它允许我调试为3ds Max(2018)编写的Python脚本。



请注意,3ds Max使用Python 2.7.12编写脚本。



我遇到的更具体或更详细的问题与Qt和PySide2有关。如果你看一下3ds提供的python示例,对我来说就是在这个文件夹中:



C:\Program Files\Autodesk \ 3dds Max 2018 \\ \\ scripts \ Python



并且文件名为:



demoPySideQWidget.py



位于文件顶部,它从PySide2导入QtCore和QtWidgets。这个演示运行正常并在从3ds脚本编辑器运行时显示对话框。



从Visual Studio端,我无法安装PySide2软件包。看起来它们与Python 2.7不兼容,在尝试添加软件包时,它显示Install PySide2(5.11.2)作为选项,但选择它会产生以下结果:



-----安装'PySide2 == 5.11.2'-----

收集PySide2 == 5.11.2

找不到满足要求的版本PySide2 == 5.11.2(来自版本:)

没有为PySide2找到匹配的分布== 5.11.2

-----失败安装'PySide2 == 5.11.2'-----



总结一下,问题是:



如何最好地配置Visual Studio 2017环境以使用3ds Max 2018强加的Python开发限制?



我尝试过:



我在VS中设置了一个自定义python环境,具有以下配置选项:



描述:3ds Max 2018 Python



前缀路径:C:\Program Files \\ Autodesk\3ds Max 2018



口译员路径:C:\Program Files \Autodesk \\\ds Max 2018 \ ndsmaxpy.exe



我没有设置以下内容,但是它是默认的。



窗口翻译:C:\Program Files\Autodesk\3ds Max 2018\3dsmaxpy.exe



语言版本:2.7



架构:64位



路径环境变量:MAXPYTHONPATH



MAXPYTHONPATH是用户定义的环境变量,包括3ds max文件夹(python和脚本子文件夹)。

I'm trying to configure my visual studio (2017) development environment so it will allow me to debug Python scripts that are written for 3ds Max (2018).

Please note, 3ds Max using Python 2.7.12 for scripting.

The more specific or detailed problem I am having has to do with Qt and PySide2. If you look at a python example provided by 3ds, for me it is in this folder:

C:\Program Files\Autodesk\3ds Max 2018\scripts\Python

and the file is called:

demoPySideQWidget.py

at the top of the file, it imports QtCore and QtWidgets from PySide2. This demo runs fine and displays the dialog when running from the 3ds script editor.

From the Visual Studio side, I can't get the PySide2 packages to install. It looks like they aren't compatible with Python 2.7, when trying to add the package, it shows Install PySide2 (5.11.2) as an option, but selecting it yields the following:

----- Installing 'PySide2==5.11.2' -----
Collecting PySide2==5.11.2
Could not find a version that satisfies the requirement PySide2==5.11.2 (from versions: )
No matching distribution found for PySide2==5.11.2
----- Failed to install 'PySide2==5.11.2' -----

To summarize, the question is:

How to best configure the Visual Studio 2017 environment to work with the Python development constraints imposed by 3ds Max 2018?

What I have tried:

I've set up a custom python environment in VS, with the following configuration options:

Description: "3ds Max 2018 Python"

Prefix path: "C:\Program Files\Autodesk\3ds Max 2018"

Interpreter path: "C:\Program Files\Autodesk\3ds Max 2018\3dsmaxpy.exe"

I didn't set the following, but it defaulted.

Windowed interpreter: "C:\Program Files\Autodesk\3ds Max 2018\3dsmaxpy.exe"

Language version: "2.7"

Architecture: "64-bit"

Path environment variable: MAXPYTHONPATH

The MAXPYTHONPATH is a user defined environment variable that includes 3ds max folders (python and script sub-folders).

推荐答案

你需要回到PySide2的文档来看看它是什么要求是。对于不熟悉Python的人来说,这听起来也是一个非常复杂的项目。您首先要花时间学习基础知识。 欢迎使用Python.org [ ^ ]。
You need to go back to the documentation for PySide2 to see what its requirements are. Also this sounds like quite a complex project for someone who is new to Python. Your time would be better spent learning the basics first. There are excellent tutorials at Welcome to Python.org[^].


这篇关于如何为3ds max Python开发设置visual studio 2017的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆