Mesh ASE files and NullReferenceException

Jun 17, 2011 at 5:42 AM

I am creating a WP7 silverlight app with 3d Models and am having issues getting ase files to display.  I'm currently using the reference audi.ASE file set with build action to resource and cannot get it to display.  I can display a box mesh without issue, but the ASE file fails with above.  code snipets below:

 includes:

xmlns:Execution="clr-namespace:Balder.Execution;assembly=Balder"
    xmlns:Geometries="clr-namespace:Balder.Objects.Geometries;assembly=Balder"
    xmlns:View="clr-namespace:Balder.View;assembly=Balder"
    xmlns:Lighting="clr-namespace:Balder.Lighting;assembly=Balder"
    xmlns:Materials="clr-namespace:Balder.Materials;assembly=Balder"

Code:

<Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Execution:Game Width="480" Height="600">
            <Execution:Game.Camera>
                <View:Camera Position="0,0,-10"/>
            </Execution:Game.Camera>
           
            <Lighting:OmniLight Diffuse="Red" Position="0,0,-5"/>

            <Geometries:Mesh AssetName="Assets/audi.ASE" />

        </Execution:Game>
 
    </Grid>

Stack Trace:

   at Balder.Content.Silverlight.FileLoader.GetStream(String assetName)
   at Balder.Assets.AssetLoaders.AseLoader.Load(String assetName)
   at Balder.Content.ContentManager.LoadInto[T](Mesh asset, String assetName)
   at Balder.Objects.Geometries.Mesh.Prepare(Viewport viewport)
   at Balder.Node.OnPrepare(Viewport viewport)
   at Balder.Rendering.NodeRenderingService.PrepareNode(Viewport viewport, INode node)
   at Balder.Rendering.NodeRenderingService.Prepare(Viewport viewport, NodeCollection nodes)
   at Balder.Scene.Prepare(Viewport viewport)
   at Balder.Display.Viewport.Prepare(PrepareMessage prepareMessage)
   at Balder.Execution.MessageSubscriptions`1.Notify(PrepareMessage message)
   at Balder.Execution.MessengerContext.Send[T](PrepareMessage message)
   at Balder.Display.WP7.Display.CompositionTargetRendering(Object sender, EventArgs e)
   at System.Windows.Media.CompositionTarget.OnRendering(Object sender, RenderingEventArgs e)
   at MS.Internal.JoltHelper.RaiseEvent(IntPtr target, UInt32 eventId, IntPtr coreEventArgs, UInt32 eventArgsTypeIndex)

Coordinator
Jun 24, 2011 at 5:47 PM

Hi,

as of today, the WP7 code is broken in Balder - so I won't be able to actually get your project and figure out whats wrong, I'm afraid. 
Hopefully within a couple of weeks, the WP7 version should be up and running again.

 

That being said, did you mark the audi.ASE as a resource in your project file?

Worth mentioning is also the possibility to use a full uri like : "<Your project name>;component/Assets/audi.ase".

 

Hope that helps. 

Jun 24, 2011 at 6:04 PM
yah I tried both, it's good to know that it's not me going crazy and
the project is broken currently. Thanks for the heads up!!!

On Fri, Jun 24, 2011 at 9:48 AM, [email removed] wrote:
> From: adept
>
> Hi,
>
> as of today, the WP7 code is broken in Balder - so I won't be able to
> actually get your project and figure out whats wrong, I'm afraid.
> Hopefully within a couple of weeks, the WP7 version should be up and running
> again.
>
>
>
> That being said, did you mark the audi.ASE as a resource in your project
> file?
>
> Worth mentioning is also the possibility to use a full uri like : "<Your
> project name>;component/Assets/audi.ase".
>
>
>
> Hope that helps.
>
> Read the full discussion online.
>
> To add a post to this discussion, reply to this email
> ([email removed])
>
> To start a new discussion for this project, email
> [email removed]
>
> You are receiving this email because you subscribed to this discussion on
> CodePlex. You can unsubscribe on CodePlex.com.
>
> Please note: Images and attachments will be removed from emails. Any posts
> to this discussion will also be available online at CodePlex.com
Jul 4, 2011 at 5:00 AM

Posting this in case it is useful to someone else.

I had a really hard time debugging a NullReference issue on ASE asset load, similar to the original question in this post. After ensuring the asset file URI was properly constructed I would still get the error. My problem turned out to be the ASE file itself, it contained a reference to a bitmap in a material that was not really used in the asset. The file is sphere.ase from one of the Silverlight 5 + Balder demos and it contains a reference to a crate.jpg file in a material definition. Once I added crate.jpg to teh project I was able to load the sphere asset OK.

Coordinator
Jul 10, 2011 at 12:58 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.