Python Info & Resources
-
- Moderator
- Posts: 754
- Joined: 25 Nov 2009, 01:41
- Contact:
Python Info & Resources
This thread is reserved for information regarding the use of python inside Softimage.
Re: Python Info & Resources
XSI Scripting Using Python: http://s3.darkvertex.com/mirror/XSIScri ... Python.pdf
Good PDF to read.
Python copy-paste gotchas: https://vimeo.com/27061025
You better use white spaces for indentation. You can convert tabs by checking "Insert spaces instead of tabs" option in File -> Preferences... window of the Script Editor.
Good PDF to read.
Python copy-paste gotchas: https://vimeo.com/27061025
You better use white spaces for indentation. You can convert tabs by checking "Insert spaces instead of tabs" option in File -> Preferences... window of the Script Editor.
Re: Python Info & Resources
Something that's worth considering before writing tools, filters etc that are supposed to deal with large geos in python..
A ->python/JS/VBS/C# benchmark I did a while ago
Results speed wise weren't in favor of python (**) when iterating through subcomponents, it performed around 30 times slower than the fastest language, VBScript.
(**) or rather the softimage python API
A ->python/JS/VBS/C# benchmark I did a while ago
Results speed wise weren't in favor of python (**) when iterating through subcomponents, it performed around 30 times slower than the fastest language, VBScript.
Code: Select all
(lower is better)
VBScript: Execution Time = 93 ms
JScript: Execution time = 113 ms
C#: Execution time = 576 ms
Python: Execution time = 3388 ms
softimage resources section updated Jan 5th 2024
Re: Python Info & Resources
http://ocw.mit.edu/courses/electrical-e ... -lectures/
This is a GREAT introduction to programing. It is very long too, but is free and of incredible quality. Python is the language used for all examples in the lecture, but it goes far beyond your average scripting tutorial. Which is good, but also time consuming...
This is a GREAT introduction to programing. It is very long too, but is free and of incredible quality. Python is the language used for all examples in the lecture, but it goes far beyond your average scripting tutorial. Which is good, but also time consuming...
Gustavo Eggert Boehs
Blog: http://www.gustavoeb.com.br/
Blog: http://www.gustavoeb.com.br/
- Hirazi Blue
- Administrator
- Posts: 5107
- Joined: 04 Jun 2009, 12:15
Re: Python Info & Resources
First things first, I’d say. I strongly recommend anyone beginning with Python to get themselves a good old-fashioned book on the language itself. The list of good Python books is quite long, do search one that suits you and read the first couple of chapters thoroughly, before even thinking about doing anything with Python in Softimage. Make sure you get a book on Python 2.* as Python 3 isn’t supported by Softimage.
And don’t let comparison benchmarks scare you off. At least not initially…
Scripting isn't much harder than "our" beloved ICE, it just asks for a different way of doing (basically the same set of) things ("writing code" instead of "plugging nodes"). If you know you're way around an ICE Tree a little bit, most of the concepts of Python shouldn't be that hard to grasp!!!
And don’t let comparison benchmarks scare you off. At least not initially…
Scripting isn't much harder than "our" beloved ICE, it just asks for a different way of doing (basically the same set of) things ("writing code" instead of "plugging nodes"). If you know you're way around an ICE Tree a little bit, most of the concepts of Python shouldn't be that hard to grasp!!!
Stay safe, sane & healthy!
Re: Python Info & Resources
On a more constructive note ... here's something that's just popped up on my Google+ feed, (Re)posted by Anthony Flores.. Not directly Python-in-Softimage related, but looks like a cool way to overcome those initial hurdles...
Online Python Tutor - Learn programming by visualizing code execution
Online Python Tutor - Learn programming by visualizing code execution
softimage resources section updated Jan 5th 2024
- csaez
- Posts: 253
- Joined: 09 Jul 2012, 15:31
- Skype: csaezmargotta
- Location: Sydney, Australia
- Contact:
Re: Python Info & Resources
Just a quick note...iamVFX wrote:You better use white spaces for indentation. You can convert tabs by checking "Insert spaces instead of tabs" option in File -> Preferences... window of the Script Editor.
PEPs (Python Enhancement Proposals) are just that, proposals. There're a lot of discussions about using tabs vs spaces and there're a lot of people using tabs without issues... so is up to you (or your company).
The SDK wizard use tabs instead of spaces so you have to convert them by your own (in almost every editor do you have an automated way to do it, not big deal).
Cheers!
-
- Moderator
- Posts: 754
- Joined: 25 Nov 2009, 01:41
- Contact:
Re: Python Info & Resources
Spaces instead of tabs is super useful other than just because. If you copy / paste code in various editors, IM clients, and email clients, they can be badly formed if you use tabs. I used to use tabs but have switched. The fact that the wizard doesn't take your preferences into consideration when generating code is not a valid argument for using tabs. Its a bug in my eyes.
- csaez
- Posts: 253
- Joined: 09 Jul 2012, 15:31
- Skype: csaezmargotta
- Location: Sydney, Australia
- Contact:
Re: Python Info & Resources
That wasn't an argument defending tabs, just something to be aware.EricTRocks wrote:Spaces instead of tabs is super useful other than just because. If you copy / paste code in various editors, IM clients, and email clients, they can be badly formed if you use tabs. I used to use tabs but have switched. The fact that the wizard doesn't take your preferences into consideration when generating code is not a valid argument for using tabs. Its a bug in my eyes.
I'm just saying PEPs are just proposals and not a mandatory thing. Both indentation methods works well enough for production code, just don't mix them.
The spaces vs tabs is a kind of holy war and I dont wanna go there.
BTW, I use spaces for personal projects and whatever my company choose at work, so no big deal for me...
-
- Moderator
- Posts: 754
- Joined: 25 Nov 2009, 01:41
- Contact:
Re: Python Info & Resources
Yeah I think the biggest thing is what you mentioned in that you should mix them.
-
- Posts: 2
- Joined: 14 Feb 2022, 11:56
Who is online
Users browsing this forum: No registered users and 63 guests