Hi @i_mazlov ,
Thank you for confirming my solution.
Best regards,
Tomasz
Latest posts made by Futurium
-
RE: List of object visible by a camera within Safe Frames
-
RE: List of object visible by a camera within Safe Frames
Hi @mogh,
Thank you for your suggestion. Currently, I've developed a method where I replace a spherical camera view with a standard camera, capture what's visible, and rotate until I've covered the entire area. This approach meets my goals, although I'm still assessing its efficiency. Your idea of rendering the image and selecting from it sounds like another option and might be a good alternative. -
RE: List of object visible by a camera within Safe Frames
Hi @i_mazlov ,
I'm writing to follow up on my previous message about the issue with 360 cameras in my code as I haven't heard back. Could you please provide any updates or further guidance?
Best regards,
Tomasz -
Troubleshooting Safe Frame Calculations Across Different Takes in Cinema 4D
Hi,
I want to calculate the safe frame value for all takes, where each take has a different camera and possibly different render settings. If I manually change a take and run my code, it returns the same safe frame for all other takes as for the currently selected one, which is incorrect in my case. It seems the values used for safe frame calculations are not being updated when I iterate through takes via code. What am I missing? I've attached a simple test scene to test the code.
Best regards,
Tomaszimport c4d def grab_children_of_main_take(take_data): children = [] mainTake = take_data.GetMainTake() take = mainTake.GetDown() while take is not None: children.append(take) take = take.GetNext() return children def get_safe_frame_for_the_current_per_take(doc): bd = doc.GetRenderBaseDraw() safeframe = bd.GetSafeFrame() print(safeframe) def main(): c4d.CallCommand(13957) # Clear Console doc = c4d.documents.GetActiveDocument() take_data = doc.GetTakeData() if take_data is None: raise RuntimeError("Failed to retrieve the take data.") children_of_main_take = grab_children_of_main_take(take_data) print("Returned : " + str(len(children_of_main_take)) + " children of main take") for child_take in children_of_main_take: take_data.SetCurrentTake(child_take) doc.ExecutePasses(bt=None, animation=True, expressions=True, caches=True, flags=c4d.BUILDFLAGS_NONE) current_camera = child_take.GetCamera(take_data) print("\n--------------------------------------------------") print(f"Checking take {child_take.GetName()} with camera {current_camera.GetName()}") get_safe_frame_for_the_current_per_take(doc) if __name__ == '__main__': c4d.CallCommand(13957) # Clear Console main()
-
RE: Speed up rendering by transforming takes into frames
Hello @ferdinand
Thank you for your guidance. I'll follow your suggestion and reach out to the support team for assistance with my query.
Best regards,
Tomasz -
Speed up rendering by transforming takes into frames
Hi,
One solution we offer our customers requires several thousand takes for each set of renders. Each take only needs 30 seconds for rendering, but the preparation phase, which involves processing geometry with Redshift, is much longer. On average, we use one camera for every 500 takes, and the only changes between takes are material swapping and toggling some geometry's visibility. I've developed a Python script that logs changes to takes and creates an animation frame for each, significantly speeding up the rendering process when rendering as an animation compared to individual takes. Is there a way to achieve this increased rendering speed with takes without converting them into animation frames? Do you have any other suggestions for enhancing render speed?Best regards,
Tomasz -
RE: List of object visible by a camera within Safe Frames
Hi Ilia,
Thank you for guiding me in the right direction. I've revised my code following your advice, and it's working well with standard cameras. However, it's having difficulty with 360 cameras. The code successfully identifies larger objects but struggles to detect smaller ones, even after I increased the accuracy (step=1, radius=1). Do you have any suggestions?
Best regards,
Tomasz -
List of object visible by a camera within Safe Frames
Hi,
I'm looking for a Python solution that can return lists of all objects visible by a camera, including both standard and Redshift Spherical cameras, and within Safe Frames. I want to include all objects, even those partially visible. I've tried using ViewportSelect (code and test scene attached) and GeCollider, but I'm not getting the results I expected, and the code runs slowly. Could you provide some suggestions and a code snippet as a starting point?
Also - for testing purposes - for the attached scene and cameras, I expect a list of specific objects (below), not all objects currently returned by my script.
Expected results:
EnSuite_Flooring_24_Reset
Bed2_Flooring_14_Reset
Landing_Flooring_30_Reset
Bed4_Flooring_18_Reset
Bed4_Flooring_18_Reset
Upstairs1_Flooring_26_Reset
ColliderBest regards,
Tomaszimport c4d doc = c4d.documents.GetActiveDocument() bd = doc.GetActiveBaseDraw() frame = bd.GetFrame() def get_flooring_objects(): flooring_objects = [] doc = c4d.documents.GetActiveDocument() helper_node = doc.SearchObject("Helpers") helper_categories = helper_node.GetChildren() for helper_cat in helper_categories: if helper_cat.GetName() == "_Flooring": flooring_objects = helper_cat.GetChildren() return flooring_objects left = frame["cl"] right = frame["cr"] top = frame["ct"] bottom = frame["cb"] # Calculates the width and height of the screen width = right - left + 1 height = bottom - top + 1 print ("width : {}, height : {}".format(width, height)) # Creates a new ViewportSelect vpSelect = c4d.utils.ViewportSelect() # Initialise the ViewportSelect with a list of object ops = get_flooring_objects() vpSelect.Init(width, height, bd, ops, c4d.Mpolyedgepoint, True, c4d.VIEWPORTSELECTFLAGS_IGNORE_HIDDEN_SEL) our_list = [] c4d.CallCommand(13957) # Clear Console for w in range(width): for h in range(height): elements = vpSelect.PickObject(bd, doc, w,h, 1, c4d.VIEWPORT_PICK_FLAGS_OGL_IGNORE_Z) our_list.extend(elements) name_list = [] for el in our_list: name_list.append(el.GetName()) unique_list = sorted(set(name_list)) for name in unique_list: print ("Unique name: {}".format(name))
Scene for testing : https://we.tl/t-FLqG7LPcNu
-
RE: Boundary Edges to Spline in Python
Dear Ilia,
I greatly appreciate your assistance; it was precisely what I needed. Thank you for your guidance and I wish you a wonderful day.
Best regards,
Tomasz