testcube.mb (61.2 KB, 221 views)
#
9
30-12-2007
, 01:39 AM
Registered User
Join Date: May 2004
Location: UK
cheers for the file Dave, it helps understand things better.
After having a quick look (its getting late) I think I understand a little more about what is going on. I might be wrong but the pointWorld value determines the xyz position in space that is being sampled. This means that when the image is rendered what is happening is that the samplerInfo node is grabbing all the pointWorld xyz values (effectively going from 0,0,0 to 0,0,1 to 0,0,2 all the way to for example 20,20,20 as points in space) and pumping them into the setRange node which is restricting the R, G or B value that is passed to the blinn shader (in this case to a value between 0.2 and 0.8). The values passed to the blinn material are mixed and the point color is produced. Phew......
So a test (if my theory is right):
Go to the samplerInfo node where you will see the pointWorld x,y and z attributes as 0,0,0.
In the script editor run the following command
Code:
$rTest = `getAttr "blinn1.colorR"`;
$rTest2 = `getAttr "blinn1.colorG"`;
$rTest3 = `getAttr "blinn1.colorB"`;
print ($rTest + " " + $rTest2 + " " + $rTest3);
It will come back with 0.5 0.5 0.5 (middle of the road)
Now alter the first pointWorld attribute value to 1 and run the code again. This time it comes back with 0.62 0.5 0.5, a higher red value. changing it to 2.5 or over results in the setRange node restricting it back to 0.8 as in its settings. Altering the second pointValue changes the Green value and the third pointWorld the Blue value. A combination of these values therefore determines what color each point (and therefore rendered pixel) on the box should be based on its position in the xyz planes.
I've not yet figured out how to get the physically intersected points where the points of the box are in 3D space but if the samplerInfo node allows you to get that then it should just be a case of iterating through all those points and dumping the position out along with the rgb values.
All this might not be useful to you yet but its real interesting to me
If I get the chance tomorrow I'l look into it further
Simon
Last edited by t1ck135; 30-12-2007 at 01:43 AM.
#
10
30-12-2007
, 04:28 AM
Registered User
Join Date: Dec 2007
ahhh you might be really on to something here!
I forgot that I can SET the worldPoint property!! That is definitely how I'm gona have to iterate through the points, but the problem, as you say is how to figure out which points it would have used in during the rendering, but I think samplerInfo may have more useful properties for determining that.
I'll play with it in the morning and let you know.
Thanks for the help - i'll let you know what i find.
David
#
11
30-12-2007
, 06:25 PM
Registered User
Join Date: Dec 2007
hmmm I dont think that works... although I could just be doing it wrong.
I think I am very close to having a plugin that I wrote to just dump everything that goes through it into a file working - so we might not have to do this anyway, but I'd be nice to understand the samplerInfo node a little better.
Let me know if you have better luck than I did and I'll post the .mll file when its working properly - they'll be a few more questions I'm sure even once that is working, like what happens if I have more than one object in the scene, does the sampler info node care about that? Also, when the scene is rendered, maya knows what to do even if you dont have a samplerInfo node at all - is the samplerInfo node just a tap into what maya already knows, or is it not the same data Maya uses to render?
#
12
30-12-2007
, 07:27 PM
Registered User
Join Date: Dec 2007
Getting close!
The attached file is really an .mll, but i had to chagne it to upload it
It makes a file called c:\data.txt with exactly what I need - the problem is if I hook up all 3 inputs, maya crashes, saying
fatal error. attempting to save in c:/blah/blah/..../Dave.20080109.1500.ma
any thoughts about that? maybe i can turn off auto save or something? not sure why it wouldn't be able to save though, and WHAT is it trying to save?
|
exporttofile.mel (45.5 KB, 210 views)
#
13
30-12-2007
, 11:14 PM
Registered User
Join Date: May 2004
Location: UK
Hi David,
Is the mll file one you wrote or found online? I'm not going to have a chance to look for a bit but I'm guessing connecting all 3 outputs to it might overload it with data. I would try just connecting one thing at a time, for example the pointWorld attribute just to see if it works and then maybe move onto a single channel. These are just ideas mind
Simon
#
14
31-12-2007
, 12:21 AM
Registered User
Join Date: Dec 2007
it is the one I wrote. It does seem like it's "overloading" it, as you say I suppose I can just output one channel at a time - I'll try that tomorrow and see if it is infact the correct points.
Thanks,
David
#
15
31-12-2007
, 12:42 AM
Subscriber
Join Date: Feb 2006
Location: Australia
its getting gimble lock
this is an interesting thread
the things one could do with a script like this is unreal
anything from advanced science simulations to advanced games.. (Im guessing anyway)
M
take it easy and life will be easy
You may not post new threads |
You may not post replies |
You may not post attachments |
You may not edit your posts |
BB code is On |
Smilies are On |
[IMG] code is On |
HTML code is Off
|