Auto Align Media Script
|
TXGorilla Falcone
KWKAT Planetfurry DJ
Join date: 4 May 2004
Posts: 176
|
03-15-2005 15:39
Is there a way to make a script align the media to the prim via eather automatic, touch, or text command?
_____________________
Drunken Monkeys danceing on the tables. Falling from the sky just like in a fable.
|
Rysidian Rubio
Ruby Red Head
Join date: 14 Jan 2004
Posts: 263
|
03-15-2005 20:42
This is an extremely good point!
There were additions to LSL to allow the Media URL to be changed (thanks!) but these are almost completely useless without either a function to align the media or have it auto align (preferrable).
_____________________
"Bad News is - I cant script a thing.... Good News is - I buy less asprin than those who can " -Rosa Gardner
|
Tiger Crossing
The Prim Maker
Join date: 18 Aug 2003
Posts: 1,560
|
03-16-2005 13:32
It wouldn't be so bad if the QT image went from 0,0 to 1,1 in the UV texture coordinates. As it is, it fills only part of the space, so it can't be used like a normal texture. If whatever calculations that crop the full streaming media texture down to just the active Quicktime portion can be built in lower-down, then we can use existing texture controls to size and tile the darn thing ourselves. Just TRY and make a video wall larger than 10x10 meters! 
_____________________
~ Tiger Crossing ~ (Nonsanity)
|
Rysidian Rubio
Ruby Red Head
Join date: 14 Jan 2004
Posts: 263
|
03-16-2005 18:11
I'm not sure what you mean there Tiger, but you can use the texture offset and repeats to manually align the video stream to a prim.
This however doesn't help very much for something simple like a scripted television that users can set their own streams for, as each stream needs individual aligning.
_____________________
"Bad News is - I cant script a thing.... Good News is - I buy less asprin than those who can " -Rosa Gardner
|
Rysidian Rubio
Ruby Red Head
Join date: 14 Jan 2004
Posts: 263
|
03-16-2005 18:18
From: Tiger Crossing Just TRY and make a video wall larger than 10x10 meters!  I'm sure that with some "fairly" simple maths this could be accomplished. Just get the texture offsets/repeats for 1 prim, then work out what they should be for the number of prims you are using for your huge screen.
_____________________
"Bad News is - I cant script a thing.... Good News is - I buy less asprin than those who can " -Rosa Gardner
|
Rysidian Rubio
Ruby Red Head
Join date: 14 Jan 2004
Posts: 263
|
03-17-2005 04:35
I've made a 4 prim screen 20m x 15m in Morris. It does sometimes not align 100% (i think due to float rounding) but usually does. Of course it still rely's on the "align texture" button, then you click the small cube labelled "click me to align large screen". Just an FYI in case anyone's interested.
_____________________
"Bad News is - I cant script a thing.... Good News is - I buy less asprin than those who can " -Rosa Gardner
|
Tiger Crossing
The Prim Maker
Join date: 18 Aug 2003
Posts: 1,560
|
03-17-2005 08:49
Yeah. Those "hoops" to jump through are why the video needs to be the whole texture, instead of just being part with green and black junk in the rest of the space. I'm hoping that's just a beta thing that will be fixed before going live. It would be a pain to rescript things if they waited to fix it later.
_____________________
~ Tiger Crossing ~ (Nonsanity)
|
Lightwave Valkyrie
Registered User
Join date: 30 Jan 2004
Posts: 666
|
03-17-2005 10:58
could it be that the base texture and video are diffrent sizes? -LW
|
Tiger Crossing
The Prim Maker
Join date: 18 Aug 2003
Posts: 1,560
|
03-17-2005 12:27
From: Lightwave Valkyrie could it be that the base texture and video are diffrent sizes? -LW That is the problem, yes. Textures must be powers of 2 to a side. The quicktime will not be, most likely. So the video only takes up a portion of the texture space, and the rest is filled with junk. The auto align button somehow knows the dimensions of the video and adjusts the UV coordinates of the object so that the video fills the whole face. What SHOULD happen is that the quicktime video is scaled to the nearest power of 2 size, just as uploaded images are. Then the video would fill the whole texture, and manipulating it from code would be easy. Right now, you can do it in code, but you have to know both the original size of the video and what size texture SL makes to hold it. Then you can calculate the percentage of the image the video fills, and use that information to assign correct UV coordinates to the object. It would be MUCH simpler if the video was scaled to begin with, instead of making the end users do the scaling in LSL without even having all the information to do so. That's all I'm saying.
_____________________
~ Tiger Crossing ~ (Nonsanity)
|
Kelly Linden
Linden Developer
Join date: 29 Mar 2004
Posts: 896
|
03-17-2005 13:51
In the latest preview (up now, 1.6.0.10) there is exactly the option Tiger is talking about. It is a toggle in the About Land->Media window.
Many texture creators in SL will tell you to create textures with dimensions in powers of 2 to get good quality and proportions. When you scale the movie to fill the texture you get a similar loss in quality as uploading a texture with odd dimensions. This is why it is an option to the parcel owner, and not done to all movies. Some people may prefer to spend the extra effort to scale the texture on the prim which will generally give a higher quality result.
We are still working on it so the quality may be improved. If we can get it looking and working really well it may become the default behavior, whether that is in time for 1.6 release or later.
I would like to add an option to llParcelMediaCommandList to set the texture parameters like the 'align' button does in the texture editor. This is hard though because the simulators don't have quicktime installed and really have no concept of or way to know the size of the movie. Would an option such as PARCEL_MEDIA_COMMAND_ALIGN_TEXTURE which takes a side and the dimensions of the movie be helpful? You would have to know in advance or in some other way get the pixel dimensions of the movie, so it is definatly not perfect. In fact it does little more than do the math for you and reduce the number of lsl calls needed for the script to set it up. There is already a script option to turn on the parcel auto align property.
_____________________
- Kelly Linden
|
Tiger Crossing
The Prim Maker
Join date: 18 Aug 2003
Posts: 1,560
|
03-17-2005 14:36
Sounds great, Kelly. I think it would help people to be able to just enter the size of the video and let the UV coordinate math be done by SL for them. A lot of people get confused by the UV values. That would also get around the question: Does SL round up to the next power of two size, or does it round to the NEAREST power of two? If the formula is built into the code, then it can be changed without breaking scripts.
_____________________
~ Tiger Crossing ~ (Nonsanity)
|
TXGorilla Falcone
KWKAT Planetfurry DJ
Join date: 4 May 2004
Posts: 176
|
The one who got lost on his own thread he started <--
03-17-2005 15:28
Ok...?
What I was talking about was a way for a script to do the same the align button in edit mode does... or even have the script just press the dern button for the user insted of all this mumbo jumbo... yes yall lost me 4 miles back... yall may be even be saying what im saying I just dont know it yet... anyway its good something is being done about it... Im at work or Id sheck to see what yall are talkin about...
Kelly Linden: "PARCEL_MEDIA_COMMAND_ALIGN_TEXTURE"
yes if thats what im talking about the yes
Kelly Linden: "There is already a script option to turn on the parcel auto align property."
Really? Can you make me a small touch script that I can put in my screen so when its not aligned I can hit the TV?
Or tell us what this script option is so we can try and use it?
In fact just to make everyone happy tave the game have it both ways... a script that just auto aligns and one so the advanced ppl can set the screen to what ever they please
_____________________
Drunken Monkeys danceing on the tables. Falling from the sky just like in a fable.
|
Kelly Linden
Linden Developer
Join date: 29 Mar 2004
Posts: 896
|
03-17-2005 17:47
TXGorilla you will probably most want to use the option in the about land panel, right under where you set the url for the movie, that will stretch the movie to the full texture size.
_____________________
- Kelly Linden
|
TXGorilla Falcone
KWKAT Planetfurry DJ
Join date: 4 May 2004
Posts: 176
|
03-17-2005 21:35
Yes I know that button is there... but not everyone can use it. 2 reasons im asking for a scripted option is for ppl that come to a land where they can input there own url but they have no wat to adjust the texture... that and im lazy that way but mostly the 1st reason
_____________________
Drunken Monkeys danceing on the tables. Falling from the sky just like in a fable.
|
Rysidian Rubio
Ruby Red Head
Join date: 14 Jan 2004
Posts: 263
|
03-17-2005 21:54
I recall last week being able to Select someone else's object (a linden's actually) and click the align button and it worked, might have beena bug tho.
This still doesn't mean that auto aligning, or function aligning isn't greatly needed.
_____________________
"Bad News is - I cant script a thing.... Good News is - I buy less asprin than those who can " -Rosa Gardner
|
Kelly Linden
Linden Developer
Join date: 29 Mar 2004
Posts: 896
|
03-18-2005 07:48
From: TXGorilla Falcone Yes I know that button is there... but not everyone can use it. 2 reasons im asking for a scripted option is for ppl that come to a land where they can input there own url but they have no wat to adjust the texture... that and im lazy that way but mostly the 1st reason Exactly. The option from the About Land window (not the texture edit window) is new and will do what you want. It will 'fix' all movies played on that parcel.
_____________________
- Kelly Linden
|
Tiger Crossing
The Prim Maker
Join date: 18 Aug 2003
Posts: 1,560
|
03-18-2005 08:00
What Kelly is saying is that there is a new checkbox in the about land menu that will basically make it Allign Media button moot. You won't need it anymore. With that checkbox on, and your base texture filling the whole face of your screen, the movie will also fill the whole screen. No additional scripting will be required.
With that checkbox off, it will behave as it did in the early 1.6 releases, and you will have to hit the align button after the movie has started playing once. Kelly mentioned a script command that would do the same as the Align button, but it would need to be told the dimentions (640x480, or whatever) of the video so it can do the alignment properly. The script runs on the server, and the server isn't streaming the video. The server doesn't know what size the video is. When you hit the button yourself, your client is telling the server the size and shape of the movie. In a function you would have to do that yourself.
BUT... As long as you don't mind a slight drop in picture quality (and I imagine it is VERY slight, nigh-on invisible) just click that checkbox and never worry about aligning again.
_____________________
~ Tiger Crossing ~ (Nonsanity)
|
RaAusar Powers
Entrepreneur
Join date: 31 Dec 1969
Posts: 64
|
03-18-2005 11:16
The Auto Align media works great. I tested several QT movie files and flash (swf) files and I barely noticed a changed in the quality.
Thanks Kelly for adding that functionality.
|
Kelly Linden
Linden Developer
Join date: 29 Mar 2004
Posts: 896
|
03-18-2005 11:37
As much as I would love to take credit, this feature as with most of the media functionality is done by Callum Linden.
_____________________
- Kelly Linden
|
TXGorilla Falcone
KWKAT Planetfurry DJ
Join date: 4 May 2004
Posts: 176
|
03-18-2005 15:31
YeeHAW!!! Thanks all yall Lindens! Yall warmed this ole Texans heart with that feature! Now I can start converting and uploading some of the PBR Recordings I got... Still need to make a mecanical bull to sit on that and find some animations!
Cant wait till we can get a SLBRL
Getter Done!
_____________________
Drunken Monkeys danceing on the tables. Falling from the sky just like in a fable.
|
Fremont Cunningham
Senior Wizard
Join date: 15 May 2004
Posts: 48
|
03-19-2005 11:33
Reading through the players posts and LL responses I suspect that LL has a slightly different view of the use of streaming video than the players do. For sound, mostly land owners will stream 'internet radio' feeds. There is rarely any short live voice feed by random players. For Video, although there will be many applications where a land owner has set up one or several static files for playing, there is also a large demand for any player to be able to play random static files, or short term live streams, eg. Web Cams. This attempted functionality has been quite popular so far in Preview 1.6, and land owners have been struggling to acheive such useful functionality for visiting players. Apart from the problems with image orientation and alignment, which LL seems to have mostly fixed, there is the on-going problem of aspect ratio. Video comes in almost any aspect ratio: (X:Y) 4:3, 8:3, 3:4, 16:9, and whatever wide screen is... and it has been pointed out many times that although the prim/texture displaying the video has to be defined at the SERVER, only the CLIENT gets the video stream which contains the pertinent information. To deal with this situation I proposed a scheme to Leopard, who has been trying to implement it, using a notecard which has the url of the stream on the first line, a float number by which to multipy Y to get X dimention for the screen on the second line (for 4:3 that would be 1.33), and a contents discription on the third line, possibly for floating text. Lines starting with # would be comments, and ignored. So, any payer can make such a notecard, drop it on a Video Player and perhaps it can set the prim/texture to the correct ratio, and play the URL. Leopard is currently working on a player implementation.
|
Rhombur Volos
King of Scripture & Kebab
Join date: 6 Oct 2004
Posts: 102
|
04-06-2005 20:45
Ah. I forgot that it's all clientside. Shucks. So there will be no way for an lsl script to detect the aspect ratio of a media file, ever? I sort of wanted a function like that. Most users don't have the patience to figure out the ratio of the media they're playing, and thus a notecard-playlist media player such as the one i smacked together after the 1.6 release would generate complaints from buyers saying things like "the pikktur lewks funny!!11?" or "i cant gett d asspect to werk lol". If there's no easy way this problem can be solved, that's all right. But if it is in any way possible, please oh please make an llGetParcelMediaAspectRatio() - command 
|
Vortex Saito
Quintzee Creator
Join date: 10 Sep 2004
Posts: 73
|
04-07-2005 02:14
Regarding aspect ratio, I just made a script in my display prim where I can change the size with llSetPrimitiveParams and llGetPrimitiveParams and reads the y of the prim and makes the according to the aspect ratio I set.
|
Leopard Loveless
Script Kitty
Join date: 30 Sep 2004
Posts: 57
|
04-07-2005 05:41
I still can do the notecard method, but having a fixed set of aspect ratios should suffice, and the screen does resize automatically.. so far I implemented 16:9 and 4:3 into my screens, and it can be expanded quite easily.
*meow* Leopard Loveless
|