feilang
05-19-2008, 09:16 AM
Hi,not to waste the resource here,I tend to post my questions in one thread.As a new user,any suggestion will be helpful to me.Thanks to warmheated guys!:)
Q1:How to refresh scene materials count after assign a material to an object?
The case is:
t=teapot()
m=standard name:"test1" color:red
t.material=m
scenematerials.count
--we get:
--$Teapot:Teapot01 @ [0.000000,0.000000,0.000000]
--test1:Standard
--test1:Standard
--1
Then go on:
n=standard name:"test2" color:green
t.material=n
scenematerials.count
--test2:Standard
--test2:Standard
--2
So it is clear: I reassigned a material to teapot but the scenematerials.count increased.When I did it in material editor ,it was correct.But not in script.Can you anybody tell me why?And how to solve it? Thank you!
Q1:How to refresh scene materials count after assign a material to an object?
The case is:
t=teapot()
m=standard name:"test1" color:red
t.material=m
scenematerials.count
--we get:
--$Teapot:Teapot01 @ [0.000000,0.000000,0.000000]
--test1:Standard
--test1:Standard
--1
Then go on:
n=standard name:"test2" color:green
t.material=n
scenematerials.count
--test2:Standard
--test2:Standard
--2
So it is clear: I reassigned a material to teapot but the scenematerials.count increased.When I did it in material editor ,it was correct.But not in script.Can you anybody tell me why?And how to solve it? Thank you!
