How would I composit two images and save the result without displaying anything?
EDIT: Ooops, sorry… posting went to where it belongs: AudioSources and AudioListeners
Sorry about that - I better go get some sleep ![]()
Jashan
I think Jashan meant to hit the New Topic button instead of reply.
Laurent, do you mean render-to-texture for an offscreen buffer?
Ricko
Yes Ricko, without any display going on, think of a command line only slating program (I need to redo mine)
Render-to-texture features are part of the Pro feature set (its how all the post processing filters are done). Then you could probably write out the results of a texture buffer after rendering to it.
Wait, do you mean without any display of any kind, including a basic unity window/player?
Ricko
Sounds like he is talking about taking two basic image files, taking A and image B and compositing them somehow and saving the result.
-Jeremy
Let’s say the end result is called slate
your maya script launches “slate” by sending to the system
"slate source destination -s startframe -f framerate -dof " etc… and slate will load source, source_dof etc… comp them all together off screen, add some text to the slate and save the whole thing to a quicktime.
Ah, so this doesn’t have anything to do with Unity. Just to make sure I am on the right page, you are asking about compositing two 2D images (or two series of images) from a command line. Is that right?
If so, there are various compositing tools you can run from a command line and call from a Maya script as you mentioned.
Since you are on a Mac, Apple’s shake tool can be run via command line. You can pass in a text based shake script for setting up the node graph and even tell it what frames. Am I closer to what you are asking about?
Ricko
I am posting on the Unity forum so yes this has something to do with Unity.
I want to redo my slate program using Unity - if it’s possible to create a headless unity app and still process texture then I have my compositor. If a Unity program can read parameters from the command line then I’m set.
To summarize:
1- does unity do headless?
2- can a unity app read command line params (I think it does)
- Nope
- Nope. Or rather not that we can access from code AFAIK.
Perhaps Ogre or some custom code is more what you want.
Using a full game engine for something like this sounds like overkill unless I am missing something. ![]()
-Jeremy
You could save your command line parameters to a .txt file and use WWW to load it. ie the command line sends the parameters to a script which saves them to a file and then launches the Unity app. Or have your script access the prefs file for your build and edit the parameters there.
You can use GetPixels and SetPixels on a texture without displaying anything. Then you could maybe use Texture2D.EncodeToPNG to save the results.
I doubt there is a point to going “headless” as this is prolly going to be very slow anyways, compared to using a more dedicated program.
Using the proverbial 500 pound gorilla - but consider the amount of time I’m investing in it, the fact that it’s the only IDE which is cross platform, stable, lightweight, fast and easy to code on and you’ll see why it makes sense to use it for everything, hell I’d even iron my shirts with it ![]()
So no headless and no command line - that’s all I wanted to know.
I saw a post on headless server somewhere so I guess this is somewhere on the might be done at some point pile.
Sorry, I guess I should clarify. You can simulate a command line by passing a command to a script that would first edit the app’s preference file and then launch your app.
Or you could leave your app running the whole time and have it check if the preference file has changed. Just open the plist in TextEdit. Type your command in the appropriate string and hit save.
You could just so a simple C# app and compile it for the Mono/.NET runtime giving you access to all the same Mono features (fast, multiplatform,etc) w/o the overhead of running the full engine. The code will be pretty much identical. A java app would also work and would be vary similar.