THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 22/03/2012 at 11:51, xxxxxxxx wrote:
I'd like to try out the functions in this class. But I can't figure out the proper way to construct it.
Example from the docs: x, y = win.Screen2Local()
That really doesn't help much. Since it doesn't say where "win" comes from. Or show how to instantiate the class. And the function doesn't even work substituting values for x&y.
This is my best guess where "win" comes from. But I can't figure out how to use any of the functions in it:
def main() :
win = c4d.gui.EditorWindow
win.Local2Screen(100,200) #Error: requires a c4d.gui.EditorWindow object
Appears to be wrong.
Can anybody offer some small example how the Local2Screen() function is supposed to be written?
On 22/03/2012 at 14:14, xxxxxxxx wrote:
Basedraw has a GetEditorWindow member.
i don't think you can just create an instance of editorwindow like in your example.
On 22/03/2012 at 14:17, xxxxxxxx wrote:
You have missed the parantheses used to instantiate the class.
Anyway, you cannot instantiate the c4d.gui.EditorWindow class. It must be obtained from a c4d.BaseDraw object or used in methods were it is given as a parameter (e.g. draw-functions).
Screen2Local() and similiar methods do not accept arguments, but return a tuple of 2 values that define the offset, i.e. the values you have to add to the values you want to convert.
bd = doc.GetActiveBaseDraw()
win = bd.GetEditorWindow()
ox, oy = win.Local2Screen()
print 200+ox, 100+oy
On 22/03/2012 at 16:40, xxxxxxxx wrote: