I confirm that with versionn 10.15.6 it works.
Once again thank you very much Maxime for your availability and quick answers!
I just installed the r23 on my laptop (macos 10.13.6) and I have exactly the same problem.
I didn't copy/past preference
It never worked
I haven't any plugin installed
it doesn't work neither in the console nor inside the CommandLine
The Cinema 4D Installation path does not contains unicode character (/Applications/Maxon Cinema 4D R23/Cinema 4D.app)
I tried to copy/paste the Cinema 4D installation directory to another place, without success
If I install python plugins they work
I'm going to wait a bit before trying to reinstall, to see if we can identify the problem ...
Thanks for the answer and sorry for the incomplete post ! You're absolutely right I should have put the code.
Here is an example:
import c4d def main(): fn = '/Users/donzeo/Documents/TEMP/ESRI_world_imagery-19.png' bmp = c4d.bitmaps.BaseBitmap() bmp.InitWith(fn) h,w = bmp.GetSize() mode = bmp.GetColorMode() if mode == c4d.COLORMODE_GRAY or mode == c4d.COLORMODE_AGRAY: flag = c4d.INITBITMAPFLAGS_GRAYSCALE else : flag = c4d.INITBITMAPFLAGS_NONE crop_bmp = c4d.bitmaps.BaseBitmap() if crop_bmp.Init(h/2,w/2,depth = bmp.GetBt(), flags = flag) == c4d.IMAGERESULT_OK: print bmp.CopyPartTo(crop_bmp, 10, 10, w/2, h/2) c4d.bitmaps.ShowBitmap(crop_bmp) if __name__=='__main__': main()
By the way it's the same with BaseBitmap.GetClonePart() (which is more simple !) :
import c4d def main(): fn = '/Users/donzeo/Documents/TEMP/ESRI_world_imagery-19.png' bmp = c4d.bitmaps.BaseBitmap() bmp.InitWith(fn) w,h = bmp.GetSize() part = bmp.GetClonePart(0,0,w/2,h/2) if part : c4d.bitmaps.ShowBitmap(part) else: print'error' if __name__=='__main__': main()
With rgb image there is no problem. With a grayscale image impossible to get anything. I tried psd, png, jpg ...
Am I doing something wrong?
The TreeViewFunctions.HeaderClick method works very well with r19, but since r20 not at all. I get an error message "SystemError: NULL object passed to Py_BuildValue".
I tested with Niklas's code (thanks to him ! ) :
(Tested with r19-> ok, r20, r21, s22-> not ok )