PDA

View Full Version : advance one on getting texture from camera view


thematt
08-21-2003, 08:26 AM
Hi guy I've post that on highend but it seems not to get much interest I understand since it's very specific..but Sorry for reposting it here but maybe that will get me somewhere thanks in advance.


Ok so, I'm looking for a way to have a texture to automaticly updated base on what a camera is seing or rendering.
To be a little bit more specific..I have a mouth that is an animated map (require for artistic reason).and I create those animation strait in maya by rendering element and using normal blend shape. so I'd like to have that texture updated automaticly once I animated my mouth .

Does anyone have an idea on if it's possible to get this done..I supposed it would require some mel if possible..but really don't know where to start...I'm not newb so don't be scare to be advance on that.

thanks a lot


cheers

MasonDoran
08-21-2003, 08:50 AM
its difficult to understand your question....but shootng from the hip my guess is this:

you want the texture to change when you change the camera?

There are 2 steps....one is Set Driven Key or an expression(mel).

You would have to use a layered texture for either of these....with the images on their own color slot with transparency set to 0%. You could then use Driven Key with a custom attribute as a driver and the transparency as the driven object. You would have to use stepped keys so that their is no blending between the textures....

using an expression would be a bit more challenging....because u lack control....but its just a matter of finding what the "driver" is....like time or some other value being output from the camera and then the expression will control the SetDriven Key.

thematt
08-21-2003, 09:44 AM
thanks for answering

but sorry, I guess I wasn't clear..
trying to explain..

I have actualy an animated map on a character for the mouth.
To create this animated map I actually use planes in maya that I deform using blend shape all in the same scene as my character and then render to create a serie of images.

What I'd like is something like would getting in real time what the camera seing and transfering that in the map slot.
Yeah i know that texture and viewport have nothing to do but it's actually something that we do in real time game all the time actually like for environnemnt mapping.

I guess to be less complicated i could just do a mel that lunch a render from a specific Camera that is place in front of my element and then automaticly load the images that are render in the map Slot..humm is someone has a better Idea.
or can give me a start on the mel that i should do that would be great..


cheers

MasonDoran
08-21-2003, 12:54 PM
well there is a the "reload file texture" command...just using that should do the trick no? You just have to make the naming convention and directory always identical if you ever change anything....render your images into a movie format...and just reload. Its not really real time though cuz you always have to render it....save it....and reload it for every change that u make.

i dont see how this particular workflow makes sense....why must u do it this way?

thematt
08-22-2003, 08:02 AM
thanks for answering again,

well it make no particular sense it's just that so far I don't have any other solution...the animation of the mouth must be an animated map (artistic choice of the director)..and I see no other way easier than creating the animated map in Maya and render it..
well I would be glad to find a better way so if anybody has something to propose that would be cool..

thanks all and you particulary 2byts

cheers

MasonDoran
08-22-2003, 09:01 AM
sounds like your art director is clueless to the actual work flow....perhaps you should discuss other possibilities as to WHAT is reasonable. If you art director does not know the proper workflow for doing something like this, then he should be more understanding of your situation.


We actually had this question on this forum before...and discovered the easiest workflow would be to project a curve on the nurbs surface and use blendshapes on the curve to form the different mouth shapes...

MasonDoran
08-22-2003, 09:08 AM
and why can u not use the method i suggested above....with a layered texture with the different textures? if it is a face for example....it would work very similar to blendshapes in concept

MasonDoran
08-22-2003, 09:15 AM
you would simply have several different animations rendered out....each one being a different phoneme....and then using layered texture you could flip between the different animations that way you can adjust the timing as you go....but the initial renders are already done.


one method that we do for texturing at work is just take screen shots of the viewport and splice them together in photoshop.....it should be effortless donkey work for you to do....after all its just a texture so the geometry that u use to create the textures can be very different then the actual geometry of the character....

the hard part that you will need to figure out is how to easily keyframe between different animations...

MasonDoran
08-22-2003, 09:21 AM
this was the thread i was talking about...

http://www.cgtalk.com/showthread.php?s=&threadid=72267&perpage=15&highlight=texture&pagenumber=2

thematt
08-22-2003, 09:24 AM
Well the layered texture are not performing morph but blend in between texture witch is to my sense quite different.
Has far as the art director not knowing the way to go, it's of course quite true but there is not much I can do since all concept and model have been validate like this with the producer and that there is no way back.

Finally the solution of the curve are good for the outline of the mouth but the iner of it is texture and should follow accordigly so that probably a problem..but i agree this is something that i should push to thanks for head up.
Btw the model is Poly..can you prject on a Poly ?I don't remenber seing that but I guess I can work taht around easily..well I'll see.

cheers

maybe you or other think of a better solution and come up with it's never too late to my sense ..at least to learn

thanks a lot

MasonDoran
08-22-2003, 10:18 AM
the layered texture should work....you just have to key the transparency using STEPPED keys so that there is no blends between the 2....its very similar to animating in flash without using tweens....


play a joke on your Producer and Art Director....ask them if they know HOW to do it......and why the concept didnt take into consideration the process needed to do it.


The old school method was to take a movie file and project it onto the character.....any and all editing of the texture was done in After effects to make sure the timing match the sound files. The 3d artist would then have to animate the rest of the character to match the movie projection. The key thing to do it this way is that u need the sound files first before you can even start animating.

If you do it like that...you would have your facial animation in a seperate file....animate and render it.....and then in your character animation file you would have your shader setup to be linked to the movie file....and then u just reload the texture whenever you want to update.

thematt
08-22-2003, 11:06 AM
well yes it's the same i'm doing now only i do the anim in maya instead of flash or After..
What i meant saying that it blend and not morph is that.;the mouth should not be in stepped key but should really morph.
Anyway the art director and Td thought that this was the ideal solution and unfortunatly i had to come up with how to make it.
Now knowing about how to do it .;seriously he doesn't give a Sh..

that's a shame I know..pfff ..anyway the poor artist are always the one to blame once thing doesn't run smooth I've been in front of that situation more than once..

cheers and thanks for your time and help greatly aprreciate.

MasonDoran
08-22-2003, 12:35 PM
sounds like you are going to need the courage to tell him the limitations of doing it they way they want. If they never considered how to do it technically by talking to you then they are responsible for the mistake not you. So just tell them that the only way to possibly do it is by doing a complete movie out of it and then projecting it BUT they have to have the sound files approved and the timing approved BEFORE you start working on the animations.


...that should at least save you some time and cover your ass in case someone else screws up. Shit always roles downhill...so best to learn how to dodge it.

part of your job is knowing what you can and cannot do and communicating that. Your boss has to respect that.


what kind of project is it?

thematt
08-22-2003, 12:48 PM
well it's for a tvseries.
SoI doubt the guy will have the final sound once they start animated around..but everything you said is true and sure I already covered my butt by telling them that...

Anyway still it's not too bad for me since I will only give them reference of animation and won't animatate during the all show.

Still I would not like to give those poor animator some kind of crappy system that will take them all there time ..through my boss and the direction don't give a damn whether or not I'd tell them which way is the safest to go.they feel they have more experience than me and that i should just shut up and do the job I've been told..but I'm exporing an other possibilities right now that might work..and will keep you inform

thanks for you help

MasonDoran
08-22-2003, 03:24 PM
well at least is some what comforting that you are not at the bottom of the hill!

wrend
08-24-2003, 11:24 AM
use the hardware render buffer, get it to write out a frame ea time you change frame. have the texture on the face an animated sequence that picks up these images as they are rendered out, or just shove them in as post render script. this is if you can accept the quality coming out of the buffer! this wont work in batch, for obvious reasons, so you just need to ensure you've run through your whole scene once before you batch, so the sequence is there.

thematt
08-25-2003, 09:26 AM
Hey 2 byts, thanks for your support ..prolblem is we've all been through that some time an know the feeling of it..pff

Wrend : thanks that's a way I was first exploring but could actually find the command to do a batch each time you change frame..does this mean using a script job..and would you know what command I should use it's not very well documented for those stuff..would that be possible to give me a head up.?
Thanks in advance.

cheers

wrend
08-26-2003, 10:19 AM
you dont need to batch at ea frame, just do a single frame ea frame so you can have the shape of the mouth for that frame on your model, so you got the interactability for playback after quick mouth tweaks. i cant figure how to get the hardware buffer to save out a single frame, but it surfices to set start and end frame the same and do a render 'sequence' (-rs) .. the command is glRender if you wernt aware, and glRenderWin for script to pop hardware window.

you might use a timeChange script job, but its a little redundant given thats what expressions are really, being evaluated ea frame. and jsut have a script that grabs your render globals range and stuffs it into the hardware render globals and does a pass before you do batch renders.

the only issue is probably going to be that you have to have the buffer window open, and un-obstructed? im 4.5, but 5.0 has probably doing a better effort now?

thematt
08-26-2003, 05:22 PM
Damn server is too busy..and erased my all answer I just typed..so hurry go again.

Well first of all thanks wrend.;the direction you pointing me is the one I was actually working on..so far the result are alright.
I use the script job to update a render at each frame and update the texture in the file section..

I'm not using the hardware rendering for obvious reason..fist is the quality is not enough and the color are not correct since it as some shading network that can't be shown..anyway I've try and found it hard to save the current image on the disk (actually couldn't find how to do it).
Second reason the Batch render is quick since the file is small and the shape of the mouth simple so it's all good for me + it doesn't have to be open..So I use the system command to lunch it (so far so good).

Only problem now (small that I'm searching right now) is to get the project directory in mel..weird but I can't get to find that one.
the worckspace command doesn't get me that which i thought it should...


Anyway thanks guysl for the great help

cheers

CGTalk Moderation
01-15-2006, 10:00 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.