Page 1 of 1

Python Lesson II

Posted: Mon Nov 20, 2006 10:30 am
by tsn
Dear friends,

now I finally managed to finish the sceond Python lesson. You can download the RTF file directly from here:

[ Link has expired. Tutorials will be revised during the next weeks ]

There´s also a solution for the last homework coming with the document. The exercise was a bit ambiguous, so in the future I´ll try to describe better what I want you to do.

Have fun,
Thomas

Python Lesson II

Posted: Mon Nov 20, 2006 12:52 pm
by shaun_michael
As always Thomas, thank you for your time and effort. It is very much appreciated.

Shaun

Python Lesson II

Posted: Wed Nov 22, 2006 2:56 pm
by tsn
Please reload the last lesson from

[ Link has expired. Tutorials will be revised during the next weeks ]

There´s a little mistake in "Example 1 - Batch Script". Well, it´s not a true mistake because the example´s working fine, but it can lead to some misunderstandings:

number_of_objects = 5
start = 0
increment = 1
factor_posX = 1.5

for objects in range (start,number_of_objects, increment):
cube = scene.addCube()
cube.setParameter("Position", Vector.new(objects * factor_posX, 0.0, 0.0))


We don´t have to introduce the last statement with a variable.

Regards,
tsn

Python Lesson II

Posted: Wed Nov 22, 2006 7:36 pm
by shaun_michael
Wow, this is excellent news Thomas. Looking forward to it.

Shaun

Python Lesson II

Posted: Fri Nov 30, 2007 7:44 am
by shiv_d
i tried a different approach:

Code: Select all

count = 1
pos = 2
mySphere = scene.addSphere()

while(count < 10):
   newSphere = scene.addSphere()
   newSpherePos = newSphere.getParameter("Position")
   newSpherePosX = newSpherePos.getX()
   newSpherePosX = count * pos
   newSphereNewPos = Vector.new(newSpherePosX, 0.0, 0.0)
   newSphere.setParameter("Position", newSphereNewPos)
   count += 1

Python Lesson II

Posted: Fri Nov 30, 2007 8:42 am
by tsn
shiv_d wrote: i tried a different approach

Thanks shiv_d. It´s nice to see that these little tuts are still on the way through the web.

Python Lesson II

Posted: Fri Nov 30, 2007 9:20 pm
by shiv_d
tsn wrote: [quote=shiv_d]i tried a different approach

Thanks shiv_d. It´s nice to see that these little tuts are still on the way through the web.[/quote]
thanks, i like your approach a lot better and more efficient.

oh and btw, your RF magazine on scripting is probably about the best thing i have got my hands on ina long time. thank you sooo much for that! :)

pleeeeease make a new one on advanced scripting =)

cheers,
SD

Python Lesson II

Posted: Fri Nov 30, 2007 9:31 pm
by shaun_michael
shiv_d wrote:

pleeeeease make a new one on advanced scripting

Ditto that.

Shaun

Python Lesson II

Posted: Sat Dec 01, 2007 8:42 am
by tsn
shiv_d wrote: oh and btw, your RF magazine on scripting is probably about the best thing i have got my hands on ina long time. thank you sooo much for that! :)

Thank you so much, shiv_d.

Indeed, I´m planning to make an issue covering advanced scripting. This, of course, needs a lot of R&D, so there´s currently no release date.

Regards,
tsn

Python Lesson II

Posted: Wed Dec 05, 2007 12:59 am
by shiv_d
tsn wrote: Thank you so much, shiv_d.

Indeed, I´m planning to make an issue covering advanced scripting. This, of course, needs a lot of R&D, so there´s currently no release date.

Regards,
tsn

wonderful! can't wait for it :)