PipelineManager - how to use?

So, what I’m trying to achieve is for now to have a program that builds a .png file into a .xnb at launch so I can later on have a nice modding system for my game without the modder having to use the pipeline GUI tool. Two problems so far: I have no clue what the complete initialization and build process for the PipelineManager should be, and my last attempt ended up throwing a nullreferenceexception at the Content.RootDirectory = “Content”; line in the Game1() constructor. I’ve included the NuGet pipeline reference btw.
Any ideas?

+: Right now, I have a dummy folder in my desktop with a “tree.png” file in it. My goals is to have the program build it to an xnb in the same folder for now.

Look at the contentpipeline’s MGCB file to see how it sends commands to build assets.

And have a look at:

:wink:

OR… you can load your PNG files directly without converting it to XNB using Texture2D.FromStream

                     using ( var mStream = XF.TitleContainer.OpenStream( pTextureFilePath ) )
                    {
                        __Texture2D = XFG.Texture2D.FromStream(  pGraphics,  mStream  );
                        mStream.Close();
                    }

@Dexter_Z_Gamer

Don’t forget that he needs to dispose this texture manually later, because of the garbage (ContentManager handles this automatically).

@Antoine_Chartier

What I do in my current editor project (Rogue Engine Editor) is to dynamically create a content response file and then just building the content with the MonoGame Content Builder. For that I call a custom .bat file which is looking like this:

@echo off

MGCB.exe /@:Content.txt >CON 2>errorLog.txt

echo.

@pause

Content.txt is the content response file and the errorLog.txt shows if errors occured.

Please take a look at the official documentation regarding this topic here:
http://www.monogame.net/documentation/?page=MGCB

It will help you to understand how to use the MonoGame Content Builder.

1 Like

Yes sir he should ^_^y if he chooses to load any resources that don’t rely on content pipeline tools
as I choose this path and have my own texture and Mesh loader(Obj, MilkShape, Delgine ) that don’t rely on content pipeline/Assimp… from there I can implement CRUD operation anywhere anytime ^ _ ^ y.

MG Asset CRUD OPERATION