VideoMaterial Torque X 3D - No functionality?
by Tim Newsome · in Torque X 3D · 02/16/2010 (5:43 pm) · 5 replies
Hey all,
I was just wondering if anyone had tried using video yet in their projects? It seems that the video will only play? Every time i try and use some of the other methods such as Stop() or Pause(), I just receive a "System.NullReferenceException was unhandled" error.
I've tried this with the demo released by garage games and its broken too.
On further investigation into the VideoMaterial.cs component there doesn’t seem to be any real functionality to the methods?
I know a little C# but its not my forte, any help would be appreciated :-)
Kind Regards
I was just wondering if anyone had tried using video yet in their projects? It seems that the video will only play? Every time i try and use some of the other methods such as Stop() or Pause(), I just receive a "System.NullReferenceException was unhandled" error.
I've tried this with the demo released by garage games and its broken too.
On further investigation into the VideoMaterial.cs component there doesn’t seem to be any real functionality to the methods?
I know a little C# but its not my forte, any help would be appreciated :-)
Kind Regards
About the author
I'm interested in all things game!
#2
The only issues I have is that none of the stop/pause/resume actions work on the videos they justy throw errors!:-(
02/16/2010 (7:44 pm)
Yeah it’s in the engine (3.1.4) they added a VideoMaterial.cs component which is supposed to handle all the video functionality. I think XNA 3.1 provides the framework with "Microsoft.Xna.Framework.Media".The only issues I have is that none of the stop/pause/resume actions work on the videos they justy throw errors!:-(
#3
http://www.torquepowered.com/community/forums/viewthread/97467/2#comments
Also, is your video even playing at all? You need to encode the video in a very specific way.
02/16/2010 (10:25 pm)
Video playback is kind of bugged in the 3.1.4 release. Are you trying to deploy to the XBox360? If so, you may want to read these posts from the TorqueX 2D forum:http://www.torquepowered.com/community/forums/viewthread/97467/2#comments
Also, is your video even playing at all? You need to encode the video in a very specific way.
#4
Yeah I have the video playing. I'm depolying to the PC.I decided not to deploy to the Xbox anymore as there are performance problems. My issue is that I want to have the video play when its triggered. So I need it to be loaded but not playing.
Hmmm its an intersting post, I'm not sure if threading would be the issue on the PC though?
This is method that came with the Torque demo, the material.Stop() is the problem.
Thanks
02/17/2010 (5:47 am)
Hey William,Yeah I have the video playing. I'm depolying to the PC.I decided not to deploy to the Xbox anymore as there are performance problems. My issue is that I want to have the video play when its triggered. So I need it to be loaded but not playing.
Hmmm its an intersting post, I'm not sure if threading would be the issue on the PC though?
public void CreateVideoPanel()
{
TorqueObject videoPanel = new TorqueObject();
T3DSceneComponent componentScene = new T3DSceneComponent();
componentScene.Position = new Vector3(400.85f, 210.2f, 15.1f);
componentScene.Rotation = new Quaternion(0.734160244f, 0, 0, 0.6789769f);
componentScene.SceneGroup = "Plane";
videoPanel.Components.AddComponent(componentScene);
VideoMaterial material = new VideoMaterial();
material.Name = "CubeSurfaceMaterial";
material.VideoFilename = @"datavideovideo_1";
material.Stop();
MaterialManager.Add(material1);
T3DPlane componentRender = new T3DPlane();
componentRender.SceneGroupName = "Plane";
componentRender.Height = 5;
componentRender.Width = 8;
componentRender.Material = material1;
videoPanel.Components.AddComponent(componentRender);
TorqueObjectDatabase.Instance.Register(videoPanel);
}This is method that came with the Torque demo, the material.Stop() is the problem.
Thanks
#5
I tried the Jason Cahill resource in Torque X3D (with a slight modification) and I got the video to play. But everytime I call any of the actions, I recieve:
System.NullReferenceException was unhandled
Message="Object reference not set to an instance of an object."
Source="StarterGame3D"
StackTrace:
at StarterGame3D.Game._pauseVideo(Single val) in C:UsersTimDocumentsVisual Studio 2008ProjectsTorque X Simple 3D VideoTorque X Simple 3D VideoGameGame.cs:line 95
at GarageGames.Torque.Sim.InputMap.ProcessInput(InputEventData data) in C:UsersTimDocumentsVisual Studio 2008ProjectsTorque X Simple 3D VideoTorque X Simple 3D VideoTorqueCoreSimInputMap.cs:line 545
at GarageGames.Torque.Sim.InputManager.ProcessInputEvent(String eventName, InputEventData inputData) in C:UsersTimDocumentsVisual Studio 2008ProjectsTorque X Simple 3D VideoTorque X Simple 3D VideoTorqueCoreSimInputManager.cs:line 630
at GarageGames.Torque.Core.TorqueEvent`1._Trigger(Delegate d) in C:UsersTimDocumentsVisual Studio 2008ProjectsTorque X Simple 3D VideoTorque X Simple 3D VideoTorqueCoreCoreTorqueEvent.cs:line 85
at GarageGames.Torque.Core.TorqueEventManager._TriggerEvent(TorqueEventBase ev) in C:UsersTimDocumentsVisual Studio 2008ProjectsTorque X Simple 3D VideoTorque X Simple 3D VideoTorqueCoreCoreTorqueEvent.cs:line 636
at GarageGames.Torque.Core.TorqueEventManager.MgrProcessEvents() in C:UsersTimDocumentsVisual Studio 2008ProjectsTorque X Simple 3D VideoTorque X Simple 3D VideoTorqueCoreCoreTorqueEvent.cs:line 477
at GarageGames.Torque.Core.TorqueEventManager.ProcessEvents() in C:UsersTimDocumentsVisual Studio 2008ProjectsTorque X Simple 3D VideoTorque X Simple 3D VideoTorqueCoreCoreTorqueEvent.cs:line 315
at GarageGames.Torque.XNA.TorqueEngineComponent.Update(GameTime gameTime) in C:UsersTimDocumentsVisual Studio 2008ProjectsTorque X Simple 3D VideoTorque X Simple 3D VideoTorqueCoreXNATorqueEngineComponent.cs:line 484
at Microsoft.Xna.Framework.Game.Update(GameTime gameTime)
at Microsoft.Xna.Framework.Game.Tick()
at Microsoft.Xna.Framework.Game.HostIdle(Object sender, EventArgs e)
at Microsoft.Xna.Framework.GameHost.OnIdle()
at Microsoft.Xna.Framework.WindowsGameHost.ApplicationIdle(Object sender, EventArgs e)
at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Microsoft.Xna.Framework.WindowsGameHost.Run()
at Microsoft.Xna.Framework.Game.Run()
at StarterGame3D.Game.Main() in C:UsersTimDocumentsVisual Studio 2008ProjectsTorque X Simple 3D VideoTorque X Simple 3D VideoGameGame.cs:line 43
InnerException:
I'm gonna run through the thread theory and see if there's any luck with that! This is tough as I'm not a coder!
02/17/2010 (6:33 am)
#EDITI tried the Jason Cahill resource in Torque X3D (with a slight modification) and I got the video to play. But everytime I call any of the actions, I recieve:
System.NullReferenceException was unhandled
Message="Object reference not set to an instance of an object."
Source="StarterGame3D"
StackTrace:
at StarterGame3D.Game._pauseVideo(Single val) in C:UsersTimDocumentsVisual Studio 2008ProjectsTorque X Simple 3D VideoTorque X Simple 3D VideoGameGame.cs:line 95
at GarageGames.Torque.Sim.InputMap.ProcessInput(InputEventData data) in C:UsersTimDocumentsVisual Studio 2008ProjectsTorque X Simple 3D VideoTorque X Simple 3D VideoTorqueCoreSimInputMap.cs:line 545
at GarageGames.Torque.Sim.InputManager.ProcessInputEvent(String eventName, InputEventData inputData) in C:UsersTimDocumentsVisual Studio 2008ProjectsTorque X Simple 3D VideoTorque X Simple 3D VideoTorqueCoreSimInputManager.cs:line 630
at GarageGames.Torque.Core.TorqueEvent`1._Trigger(Delegate d) in C:UsersTimDocumentsVisual Studio 2008ProjectsTorque X Simple 3D VideoTorque X Simple 3D VideoTorqueCoreCoreTorqueEvent.cs:line 85
at GarageGames.Torque.Core.TorqueEventManager._TriggerEvent(TorqueEventBase ev) in C:UsersTimDocumentsVisual Studio 2008ProjectsTorque X Simple 3D VideoTorque X Simple 3D VideoTorqueCoreCoreTorqueEvent.cs:line 636
at GarageGames.Torque.Core.TorqueEventManager.MgrProcessEvents() in C:UsersTimDocumentsVisual Studio 2008ProjectsTorque X Simple 3D VideoTorque X Simple 3D VideoTorqueCoreCoreTorqueEvent.cs:line 477
at GarageGames.Torque.Core.TorqueEventManager.ProcessEvents() in C:UsersTimDocumentsVisual Studio 2008ProjectsTorque X Simple 3D VideoTorque X Simple 3D VideoTorqueCoreCoreTorqueEvent.cs:line 315
at GarageGames.Torque.XNA.TorqueEngineComponent.Update(GameTime gameTime) in C:UsersTimDocumentsVisual Studio 2008ProjectsTorque X Simple 3D VideoTorque X Simple 3D VideoTorqueCoreXNATorqueEngineComponent.cs:line 484
at Microsoft.Xna.Framework.Game.Update(GameTime gameTime)
at Microsoft.Xna.Framework.Game.Tick()
at Microsoft.Xna.Framework.Game.HostIdle(Object sender, EventArgs e)
at Microsoft.Xna.Framework.GameHost.OnIdle()
at Microsoft.Xna.Framework.WindowsGameHost.ApplicationIdle(Object sender, EventArgs e)
at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Microsoft.Xna.Framework.WindowsGameHost.Run()
at Microsoft.Xna.Framework.Game.Run()
at StarterGame3D.Game.Main() in C:UsersTimDocumentsVisual Studio 2008ProjectsTorque X Simple 3D VideoTorque X Simple 3D VideoGameGame.cs:line 43
InnerException:
I'm gonna run through the thread theory and see if there's any luck with that! This is tough as I'm not a coder!
Associate David Montgomery-Blake
David MontgomeryBlake