Jump to content

MaxWhite

Regular Member
  • Content Count

    3
  • Joined

  • Last visited

Community Reputation

0 Noble Beginner

Profile Information

  • First Name
    Max
  • Last Name
    White
  • Location
    Chelabinsk

Cinema 4D Information

  • C4D Version
    R20 Visualize

Hardware Information

  • CPU/GPU
    Cpu
  1. Code example: import os import sys import c4d def PluginMessage(_id, data): if _id == c4d.C4DPL_COMMANDLINEARGS: print sys.argv walker() return True return False def walker(step_x=5,step_y=5): doc = c4d.documents.GetActiveDocument() print "Document: {}".format(doc) bd = doc.GetRenderBaseDraw() print "BaseDraw: {}".format(bd) safeframe = bd.GetSafeFrame() print "SafeFrame: {}".format(safeframe) arr_o = [] for y in range(safeframe['cl'],safeframe['cr'],step_y): for x in range(safeframe['ct'],safeframe['cb'],step_x): o = c4d.utils.ViewportSelect.PickObject(bd, doc, x, y, rad=1, flags=c4d.VIEWPORT_PICK_FLAGS_OGL_ONLY_TOPMOST_WITH_OBJ | c4d.VIEWPORT_PICK_FLAGS_OGL_ONLY_VISIBLE) if o: try: arr_o.append(o[0]) except IndexError as e: print(e) print "Array of objects: {}".format(arr_o) return arr_o Output: ['C:\\Users\\Administrator\\Documents\\1.c4d', '-nogui'] Document: <c4d.documents.BaseDocument object called '' with ID 110059 at 0x00000 08ABA5CC3B0> BaseDraw: <c4d.BaseDraw object called 'Perspective' with ID 110305 at 0x0000008A BA5CC3F0> SafeFrame: {'cr': 0, 'ct': 0, 'cb': 0, 'cl': 0} Array of objects: [] Cmd command: C:\Program Files\MAXON\Cinema 4D R20>Commandline.exe "C:\Users\Administrator\Documents\1.c4d" -nogui
  2. I am writing a script that runs the C4d command line ("Commandline.exe" - nogui, etc.) and works in it.The Gui console is the console that is called with shift+F10 in c4d.
  3. I think problem is C4d is not initialized BaseDraw from Commandline because BaseDraw, PickObject, GetFrame didn't in Gui console. I tried to take BaseDraw.GetSafeFrame () and got 0,0,0,0. Also tried to run the script from Gui, I was able to get GetFrame () when I did BaseDraw.InitializeView (self, doc, cam, editorsv) (but still not the same as the console in Gui). In fact PickObject, GetFrame work well in Gui console.
×
×
  • Create New...

FORUMS INFO:

Dear members, we are aware of few more bugs that are still present withing the theme.We just wanted to let you know that we are working to fix them as soon as possible.
 

NEW MEMBERS:

Please be aware that we are manually approving all new registrations, due to spam prevention. Please be patient in case you cannot login right away, we will approve you within 12h or less if we decide you are not potential spammer. 

 

Thanks for understanding! :cowboypistol: