Editing a fixture and apply to existing patch

Write here what nice effects or shows you have done with MADRIX or ask other users.

Moderator: MADRIX Team

Locked
mrbob20
Posts: 1
Joined: Mon Jul 29, 2013 3:06 pm

Editing a fixture and apply to existing patch

Post by mrbob20 »

Hi,

I have a very complex patch, that I have patched using the generic RGB fitting.

I have just received my strips and the colour order is BRG :(

I have edited the generic RGB fixture in the fixture editor so that the colour order is BRG.

When I patch new fittings, this works, but it hasn't worked for the existing fittings.

Is there any way I can make this change to the existing fittings?

thanks

Bob
jaekel
Developer
Developer
Posts: 9
Joined: Wed Dec 02, 2009 10:23 am

Re: Editing a fixture and apply to existing patch

Post by jaekel »

Hi mrbob20,

sorry there no simple way for do that.

Your have 3 ways:

1.)
Use an MainOut macro for change the color RGB to BGR e.g.

Code: Select all

@scriptname="RGB to BGR";
@author="jky";
@version="1.0 / 1. Aug 2013";
@description="Transform complete mainout matrix from RGB to BGR color";

color matrix[][];
color Col_RGB;
color Col_BGR;

int SizeX=GetMatrixWidth();
int SizeY=GetMatrixHeight();

void InitEffect()
{
	SizeX=GetMatrixWidth();
	SizeY=GetMatrixHeight();
}

void PreRenderEffect()
{
}

void PostRenderEffect()
{
	GetPixelArea(matrix); // get RGB colored matrix
	for(int x=0;x<SizeX;x++)
	{
		for(int y=0;y<SizeY;y++)
		{
			// get RGB color from pixel
			Col_RGB=matrix[x][y];
			// transform RGB -> BGR         			
			Col_BGR.b=Col_RGB.r;
			Col_BGR.g=Col_RGB.g;
			Col_BGR.r=Col_RGB.b;
			// set BGR color for pixel
			matrix[x][y]=Col_BGR;
		}
	}
	DrawPixelArea(matrix); // set BGR colored matrix		
}

void MatrixSizeChanged()
{
	InitEffect();
}



2.)
If you work with MADRIX3 you can save the patch as *.mpx file. Then edit this file with you favorit XML editor and replace the RGB fixture with the BGR fixture via "Search and Replace" function.

3.)
If you work wit MADRIX 2.x send a mail with the MADRIX patch file to info[at]madrix.com
Lets see what we can do.

Jaekel
reporter
Posts: 61
Joined: Wed May 06, 2009 8:56 pm

Re: Editing a fixture and apply to existing patch

Post by reporter »

Hi,

I just had the exact same issue happen to me. I exported the patch as xml and did a mass find and replace.

the necessary parts to change are the color channel information:

Code: Select all

                <channel version="0x03000000" name="Color Red" />
                <channel version="0x03000000" name="Color Green" number="1" color_channel="1"/>
                <channel version="0x03000000" name="Color Blue" number="2" color_channel="2"/>
Change those lines, for every pixel, to:

Code: Select all

                <channel version="0x03000000" name="Color Blue" color_channel="2"/>
                <channel version="0x03000000" name="Color Green" number="1" color_channel="1"/>
                <channel version="0x03000000" name="Color Red" number="2"/>
After that, you could go through and copy and replace all "RGB" with "BGR". Changing that won't have any impact on your patch, but it will make it so you can understand the patch better.

Hope that helps anyone else!
Locked