PDA

View Full Version : Simple questions difficult to me


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!

ZeBoxx2
05-19-2008, 10:09 AM
Not that simple a question :) Thankfully, Bobo answered it previously; See:
http://forums.cgsociety.org/showpost.php?p=4774578&postcount=2

feilang
05-20-2008, 01:41 AM
Hey,ZeBoxx2,thank you first! I had looked for it everywhere here,without any result.So BoBo had explained it, great!
Actually,I also have found a way to solve it ,that is run Views-- Activate All Maps
which is in code:
actionMan.executeAction 0 "40807" -- Views: Activate All Maps
As BoBo said,"if your scene is large, it would mean wasting time." But this manipulation is not only wasting time,but also leading to crash. So I dare not to use it in my script.Expecting a much better method to solve it.

feilang
06-17-2008, 01:30 PM
Q2:How to render anthoer scene in my scene and get the renderout bitmap?
theFile = (GetDir #Scene + "\\temp.max (file://\temp.max)")
saveNode #(BOX()) theFile

......

RenderOutMap = ......

Is there a method to realize this?Any help will be welcome, thank you first!

CGTalk Moderation
06-17-2008, 01:30 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.