IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 游戏开发 -> Mayabatch and Python - Introduction & Part 1 Introduction -> 正文阅读

[游戏开发]Mayabatch and Python - Introduction & Part 1 Introduction

Introduction?

I wasn't able to find much information about running scripts within mayabatch when I first started looking into how to do this myself. There's loads of info out there about running renders via mayabatch but not much about how to do other things with it (ie run scripts on a file rather than just rendering a file).

I hope to lay out some basic tutorials over the next few month on how to do this, as much for myself as anything else. For anyone else reading this please note the following:

This will only be relevant to Windows and possibly with specific reference to Windows 10. Sorry to Mac and Linux users out there but I've not got experience of using those systems so I have nothing to offer about how to do this on those OS.

These tutorials will also assume at least a basic understanding of Python.?If you're not familiar with Python, then I would recommend checking out Jeremy Ernst's Vimeo channel, specifically his Building Maya Interfaces with Python series which starts with this video: https://vimeo.com/42848594

First I should start with how to actually run mayabatch.exe via the command line in windows, a very basic step but one that seems to be overlooked by others when teaching about this kind of thing.

Part 1 - Running mayabatch for the first time

There are two basic ways to get mayabatch up and running.
  1. Run cmd directly in the Maya bin
  2. Define where the mayabatch.exe actually is on the system before you try and run it.

Option #1 - Run cmd in the Maya bin

  • Navigate to your maya bin folder. This is the program files of your windows machine. Most likely it will look like this:
C:\Program Files\Autodesk\Maya2015\bin?
(obviously change the maya version to the one you're using eg 'Maya2016')
  • Type cmd into the address bar of the explorer once you're here:

This is where you want to type 'cmd'

  • This will open a cmd terminal looking like this:

This means that the cmd terminal will understand what and where mayabatch is. Note that this is different from running cmd from anywhere else in Windows. (ie from the start menu, the Run command, or the same process but in another folder)
  • type in mayabatch.exe and hit enter, this will open a version of maya without a UI.?

It'll take a second or two to start but and once it's loaded it it'll close itself down again given that it's got nothing to do. You'll basically see something like this:




I'm not really sure what the error about Bifrost is about, something for me to look into another time perhaps.

Option #2 - Define where mayabatch is on the system


  • Open a normal command prompt terminal. Type 'cmd' into the start menu and hit enter.

  • This will bring up a command terminal much like the other but notice that the folder path is different. It should default to the current user's path.

  • This time we need to specify where the mayabatch.exe actually is for it to run. Type in the file path for mayabatch (or copy and paste it). This will most likely be:?
C:\Program Files\Autodesk\Maya2015\bin\mayabatch.exe
(again change the version number to the version of maya you have installed)

Here's the error you get when you try to run mayabatch with a space in program files

  • ?The thing is this will cause errors in the command prompt because it can't resolve the space in 'Program Files' part of the path. The way around this is to change the path we're using slightly. Changing 'Program Files' to 'Progra~1' allows command prompt to read the path properly.
C:\Progra~1\Autodesk\Maya2015\bin\mayabatch.exe

Here we see mayabatch running. Note that where you put the '~1' is important as if it's in the wrong place you'll get an error.


That's the end of this part of the tutorial, next time I'll go into more details about how to open files in maya batch followed by how to run scripts on opend files.







  游戏开发 最新文章
6、英飞凌-AURIX-TC3XX: PWM实验之使用 GT
泛型自动装箱
CubeMax添加Rtthread操作系统 组件STM32F10
python多线程编程:如何优雅地关闭线程
数据类型隐式转换导致的阻塞
WebAPi实现多文件上传,并附带参数
from origin ‘null‘ has been blocked by
UE4 蓝图调用C++函数(附带项目工程)
Unity学习笔记(一)结构体的简单理解与应用
【Memory As a Programming Concept in C a
上一篇文章      下一篇文章      查看所有文章
加:2022-04-15 00:35:02  更:2022-04-15 00:36:42 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年11日历 -2024/11/23 16:50:54-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码