A new version of Cineversity has been launched. This legacy site and its tutorials will remain accessible for a limited transition period

Visit the New Cineversity
   
 
General python objects and breaking out/referencing
Posted: 18 January 2017 09:07 AM   [ Ignore ]  
Total Posts:  108
Joined  2015-11-30

Up until now I’ve mainly used xpresso for complex setups, and I’ve enjoyed the convenience of the python node for more tricky data handling, but mainly to save space and not have to use many cluttered xpresso nodes. I’ve also made some simple python scripts in the past.

There’s some general things which I’d like to understand better though.
I don’t really understand the difference between all the different kinds of python/scripting objects;

xpresso python node, (runs every frame, that’s all I know)
python generator,
python tag,
python effector,
python script, (runs once..?)

The main thing I’m interested in, how are variables treated in these different contexts, and how is the code executed.

When you write code in any of these contexts (is that even the right terminology?) what are the differences, is it aware of what kind of object it is, does it mean you can make calls (again not sure right terminology) which you couldn’t from other types? or does it mean the calls/references need to be different depending on the python object you are working from?

I’m used to coding in java, and have basic python experience (arrays, loops, conditional statements etc).
The one thing I am comfortable with is the script manager, I know I can create variables which are stored, iterate/increment them etc.

Just thought I’d post this before I started looking up this stuff online, so there’s a parallel source of info.

Profile
 
 
Posted: 18 January 2017 04:10 PM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi NNenov,

The main question about the five different ways to use Python scripts leads me to move this question into the tutorial request forum. Let me know if that is OK with you.

Yes, scripts are powerful and in many cases re-usable, e.g., in XPresso. The difference is mostly given what and where and when they do their work. For example the Python Effector will stop working in any connection with a cached solution. Some run only when requested, like plug ins that change an object one time.

I’m not a coder, and I say this often, in respect to people who really do that for a living. (I have a loose relationship to it, and I love it since I wrote my first “program” in the early ‘80s for a house-heat requirement “app”, which could also plot graphs over walls out. )

Having said that, my exploration of all of these parts so far, and my little introduction (what, where , when they work) leads me to say, that it wouldn’t even a good idea if variables could be application wide. Hierarchy/Priority and Refreshing, Resetting are certainly some areas that would create an very complex “processing tree”, perhaps a dynamically one with sometimes loops, i.e. self references, IMHO.

What I saw often (well, that’s relative) is, that scrips that move across several areas uses User Data. Mostly to publish from one source to distribute it to others, not as a “first comes first served”[FCFS] idea.

Variables inside of a script, with several Functions, might use “Global” for variables to share those, but also here, it should be done with care.

You will find some Python scripting tutorials here on Cineversity, just use the search options.

After all, the main area is and should be the
https://developers.maxon.net

and especially here for a discussion about it

http://www.plugincafe.com/forum/default.asp

Additional
https://www.cineversity.com/learn/scripting

And of course the Wiki
https://www.cineversity.com/wiki

I hope that helps.

There is more and I even a series that fits exactly your question about the five main elements, is over at FXPHD.com and it is called C4D208 by Michael Auerswald. Certainly worth it.

My best wishes for your further exploration.

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
Posted: 21 January 2017 02:21 PM   [ Ignore ]   [ # 2 ]  
Total Posts:  108
Joined  2015-11-30

That’s a great idea, would be nice to see a tutorial on this.

Thank you for the links, they look great, and for your advice.

Sorry for the late reply!

Profile
 
 
Posted: 21 January 2017 03:41 PM   [ Ignore ]   [ # 3 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

You’re very welcome, NNenov.

Please don’t worry about late replies, I know that life sometimes takes over wink

Have a great weekend

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile