Hi,
In the attached image I have what I think is a very easy problem to solve but one that I can not solve.
I have a list of channels that go “B G R” (I believe the reorder’s numeric suffix sort also reorders things alphabetically" and I want to swap it so the Red channel comes first (ideally with the correct label (of R) as well).
You could select CHOP out each chunk, example: r* , g*, b* and merge the 3 select CHOPs back together.
Or you could create a constant CHOP with the order you need: r[0-9], g[0-9], b[0-9]
and then use that as reference input to the Reorder CHOP, or even input to a Replace CHOP.
Sorry Rob, I was unclear with my question and that photo scrolls to a position that is not illustrative. What I have is something like
b0
g0
r0
b1
g1
r1
b2
g2
r2
And what I want is to flip the first and third channel positions so that I have:
r0
g0
b0
r1
g1
b1
r2
g2
b2
In otherwise flip the first and third channels, every three channels. Is there a way to do that?
['r'+str(x).zfill(2) + ' g'+str(x).zfill(2) + ' b'+str(x).zfill(2) for x in range(0,int(me.inputs[0].numChans/3))]
You can pad the integer string with zfill. That should give you a string like: r00 g00 b00 r01 g01 b01 r02 g02 b02… If you don’t know how many channels you will have, assuming that you’ll have r, g, b for each, you can replace the 2 with
You can use the reorder chop, using numeric suffix sort. The thing is that it sorts the basename of the channel alphabetically, so you will end up with
b0
g0
r0
.
.
.
Unless you simply rename the channels to r=a, g=b, b=c (or x,y,z or whatever) before reordering. So you simply make sure your desired order works for alphabetic ordering. You can then rename the channels back to r,g,b if needed.
first Shuffle CHOP select Method: “Sequence Channels by Name”
This will give you 3 channels called r, g and b
Next append a Shuffle CHOP and choose Method: “Sequence all Samples”
This will give you 1 channel with the samples from r, g and b appended to each other in the order you like…
Hi all,
I reply now because in TD099 the code celina posted seems to work in a different way: it outputs ‘r0 g0 b0’ ‘r1 b1 b2’ etc…any idea on how to make it work?
Necro-ing to provide a solution in case anyone else finds this thread and was as confused as I was:
The least headache-inducing way to solve this that I found is to order your channels with a shuffle CHOP first (in my case I needed sequences of GRB, so I used the “split all samples” method to get g0, g1… r0,r1… b0,b1…)
the Reorder is a bit expensive for this procedure.
If you need the channels separately (would be interesting to see why and how you could avoid that) first append a Shuffle CHOP and choose the “Sequence All Samples” option from the Method parameter and after append a Shuffle CHOP now choosing “Split all Samples”.