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
-
- Posts: 4766
- Joined: Sun Sep 10, 2006 8:04 am
Python Lesson II
As always Thomas, thank you for your time and effort. It is very much appreciated.
Shaun
Shaun
Python Lesson II
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
[ 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
-
- Posts: 4766
- Joined: Sun Sep 10, 2006 8:04 am
Python Lesson II
Wow, this is excellent news Thomas. Looking forward to it.
Shaun
Shaun
Python Lesson II
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
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
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
-
- Posts: 4766
- Joined: Sun Sep 10, 2006 8:04 am
Python Lesson II
shiv_d wrote:
pleeeeease make a new one on advanced scripting
Ditto that.
Shaun
Python Lesson II
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
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 :)
Return to “Python Tutorials and Resources”
Who is online
Users browsing this forum: No registered users and 1 guest