Notifications
Clear all

[Closed] getPixels setPixels and objectID channels

Hi, trying to copy pixels from one image of a specific objectID and write them to another
image to the same objectID. I have two existing identical images with different material
schemes. The examples are of a house. I want to copy say the pixels of a window popout
from one image, and write them to the pixels of the same popout (different material) on the second image. I found an example in the rendereffects of a colorize routine. I just can’t seem to figure out a way to specify the exact objectID that I want to copy the pixels of.
Can anyone help me out with this? My understanding of this is newb. I’m not trying to write
a render effects routine, just a simple script to open up two images and copy pixels from one, and write them to another. THis example just basically just rewrites the entire 1st image over the second image, but it’s a structure of what I want to do anyway. ugh.

on btnBmp1 pressed do (
bmp1 = selectbitmap()
tmpBmp1 = bitmap 400 300
copy bmp1 tmpBmp1
uiBmp1.bitmap = tmpBmp1
)

on btnBmp2 pressed do (
bmp2 = selectbitmap()
tmpBmp2 = bitmap 400 300
copy bmp2 tmpBmp2
uiBmp2.bitmap = tmpBmp2
)

on btnGo pressed do (
sline = #()
for h=0 to (bmp1.height-1) do
(
for w=0 to (bmp1.width-1) do
(
sline = (getPixels bmp1 [w,h] 1) [1]
(

objchan = getchannel bmp1 [w,h] #objectID
)

setPixels bmp2 [w,h] #(sline)
)
)
display bmp2

)