A 3dsmax rendering progress acquisition method based on cloud rendering
By using Python's win32gui module to automatically obtain 3ds Max rendering progress, identify the rendering window, calculate the progress percentage, and write it to a cloud storage file, the tedious and labor-intensive problem in existing technologies is solved, and automated rendering progress monitoring is achieved.
Patent Information
- Application Number
- CN202411644103.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2044-11-18
AI Technical Summary
In large-scale 3ds Max rendering, existing methods require logging into each machine to check the rendering progress of frames, which is cumbersome and wastes manpower.
The system uses Python's win32gui module to obtain the real-time window of the 3ds Max process, identifies the class name and text information of the rendering window, calculates the rendering progress percentage, and writes the results to a cloud storage file.
It enables automatic acquisition of rendering progress for each frame, freeing up manpower, saving time and effort, and overcoming the shortcomings of existing technologies.
Smart Images

Figure CN119600168B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of rendering technology, and in particular to a method for obtaining 3ds Max rendering progress based on cloud rendering. Background Technology
[0002] For large-scale 3ds Max rendering, when there are multiple frames, each frame is assigned to a different cloud machine for rendering. If you want to know the rendering progress of each frame, you need to log in to each machine to check, which is both tedious and wastes manpower.
[0003] Therefore, existing technologies have shortcomings and need to be improved. Summary of the Invention
[0004] The technical problem to be solved by this invention is to provide a 3ds Max rendering progress acquisition method based on cloud rendering, which can automatically acquire the image rendering progress and solve the shortcomings of existing methods such as wasting manpower.
[0005] The technical solution of the present invention is as follows: a method for obtaining 3ds Max rendering progress based on cloud rendering is provided, including the following steps.
[0006] S1: Get the process ID of 3ds Max.
[0007] S2: Obtain all live windows with process ID S1 using the win32gui module in the third-party Python package win32.
[0008] S3: Given that the class name of the 3ds Max rendering window is fixed as "#32770", loop through all the real-time windows obtained in S2 and find the window with the class name "#32770" using the win32gui.GetClassName() method.
[0009] S4: Use win32gui.GetWindowText() to get the following text information in the window: Current Task:Rendering pass 44(elapsed:M,left:N).
[0010] S5: Calculate the rendering progress percentage using the text information obtained in S4. The calculation method is as follows: Get the rendered time elapsed:M and convert M to seconds; get the estimated remaining rendering time left:N and convert N to seconds; calculate the percentage progress: number of seconds rendered / (number of seconds rendered + estimated remaining rendering seconds) * 100%.
[0011] S6: Write the rendering progress percentage calculated in S5 and the rendering progress text information obtained in S4 into the cloud storage progress file. In step S6, check the rendering progress of each frame by viewing the progress file in the cloud storage.
[0012] In this invention, the process ID of 3ds Max is first obtained. Then, the real-time windows of all 3ds Max process IDs are obtained using the win32gui module in the third-party Python package win32. These real-time windows contain the rendered time and the estimated remaining rendering time. The following text information is obtained from the window using win32gui.GetWindowText(): Current Task:Rendering pass 44(elapsed:M,left:N), where M is the rendered time and N is the estimated remaining rendering time. The rendering progress percentage is calculated as: (number of seconds rendered / (number of seconds rendered + estimated remaining rendering seconds)) * 100%. This percentage is then written to a cloud storage progress file, allowing users to view the rendering progress of each frame. Since the rendering progress of all frames can be viewed in the cloud storage progress file, users do not need to log into each machine to check the rendering progress of each frame. This invention greatly reduces manpower and saves time, overcoming the shortcomings of existing technologies and facilitating application.
[0013] Furthermore, both M and N are in the format of hours.minutes.seconds.
[0014] Furthermore, in step S2, the specific steps for obtaining all real-time windows with process ID S1 are as follows:
[0015] S21: Import the necessary win32gui modules:
[0016] Python
[0017] import win32gui
[0018] import win32process;
[0019] S22: Define a callback function to iterate through all windows and obtain their process IDs:
[0020] Python
[0021] def enum_windows_callback(hwnd,pid_list):
[0022] _, pid=win32process.GetWindowThreadProcessId(hwnd)
[0023] if pid is in pid_list:
[0024] win32gui.ShowWindow(hwnd,1) # Optional: Makes the window visible
[0025] print(f"Window Handle:{hwnd},Process ID:{pid}");
[0026] S23: Obtaining the 3ds Max Process ID: First, you need to find the 3ds Max process ID. This can be achieved by iterating through all processes in the system:
[0027] Python
[0028] def get_process_id(process_name):
[0029] pid_list=[]
[0030] win32gui.EnumProcesses(None,0,win32gui.LIST_SYSTEM_PROCESSES)
[0031] for pid in win32gui.GetProcessList():
[0032] try:
[0033] p
[0034] win32process.OpenProcess(win32con.PROCESS_QUERY_INFORMATI ON|win32con.PROCESS_VM_READ,False,pid[0])
[0035] if process_name.lower()in win32process.GetModuleBaseName(p,0).lower():
[0036] pid_list.append(pid[0])
[0037] win32process.CloseHandle(p)
[0038] except win32gui.error:
[0039] pass
[0040] return pid_list
[0041] # Use 3ds Max process names to get a list of process IDs
[0042] pid_list=get_process_id('3dsmax.exe');
[0043] S24: Traverse all windows and call the callback function:
[0044] Python
[0045] #Traverse all top-level windows
[0046] win32gui.EnumWindows(enum_windows_callback,pid_list);
[0047] S25: Execute the above code: Combine the above code snippets and execute them to obtain all window handles and corresponding process IDs of 3ds Max.
[0048] Furthermore, the enum_windows_callback function in the above code will print out the window handles and process IDs of all matching process IDs.
[0049] Furthermore, the win32gui.GetWindowText function is used to obtain the window title, and the win32gui.GetWindowRect function is used to obtain the window size and position.
[0050] By adopting the above scheme, the present invention provides a 3ds Max rendering progress acquisition method based on cloud rendering. By executing the method of the present invention during the rendering process, the rendering progress of each frame of 3ds Max is obtained, and the corresponding text file is generated and saved in public storage. In this way, the rendering progress of each frame can be viewed by simply checking the corresponding text file in public storage; thus achieving the effect of freeing up manpower, facilitating convenience and saving time, and solving the shortcomings of the prior art. Attached Figure Description
[0051] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation
[0052] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments.
[0053] Please see Figure 1 This invention provides a method for obtaining 3ds Max rendering progress based on cloud rendering, including the following steps.
[0054] S1: Get the process ID of 3ds Max.
[0055] S2: Obtain all live windows with process ID S1 using the win32gui module in the third-party Python package win32.
[0056] S3: Given that the class name of the 3ds Max rendering window is fixed as "#32770", loop through all the real-time windows obtained in S2 and find the window with the class name "#32770" using the win32gui.GetClassName() method.
[0057] S4: Use win32gui.GetWindowText() to get the following text information in the window: Current Task:Rendering pass 44(elapsed:M (e.g., 2:51:13),left:N (e.g., 0:12:36)).
[0058] S5: Calculate the rendering progress percentage using the text information obtained in S4. The calculation method is as follows: The rendered time elapsed: 2:51:13 is converted to seconds: 2*60*60 + 51*60 + 13 = 10273s; the estimated remaining rendering time left: 0:12:36 is converted to seconds: 0*60*60 + 12*60 + 36 = 756s; Calculate the percentage progress: (number of seconds rendered / (number of seconds rendered + estimated remaining seconds)) * 100; the calculation is as follows: 10273 / (10273 + 756) * 100% = 93%; therefore, the current rendering progress is 93%.
[0059] S6: Write the rendering progress percentage calculated in S5 and the rendering progress text information obtained in S4 into the cloud storage progress file. In step S6, check the rendering progress of each frame by viewing the progress file in the cloud storage.
[0060] In this embodiment, both M and N are in the format of hours.minutes.seconds.
[0061] In this embodiment, the specific steps for obtaining all real-time windows with process ID S1 in step S2 are as follows:
[0062] S21: Import the necessary win32gui modules:
[0063] Python
[0064] import win32gui
[0065] import win32process;
[0066] S22: Define a callback function to iterate through all windows and obtain their process IDs:
[0067] Python
[0068] def enum_windows_callback(hwnd,pid_list):
[0069] _, pid=win32process.GetWindowThreadProcessId(hwnd)
[0070] if pid is in pid_list:
[0071] win32gui.ShowWindow(hwnd,1) # Optional: Makes the window visible
[0072] print(f"Window Handle:{hwnd},Process ID:{pid}");
[0073] S23: Obtaining the 3ds Max Process ID: First, you need to find the 3ds Max process ID. This can be achieved by iterating through all processes in the system:
[0074] Python
[0075] def get_process_id(process_name):
[0076] pid_list=[]
[0077] win32gui.EnumProcesses(None,0,win32gui.LIST_SYSTEM_PROCESSES)
[0078] for pid in win32gui.GetProcessList():
[0079] try:
[0080] p
[0081] win32process.OpenProcess(win32con.PROCESS_QUERY_INFORMATI ON|win32con.PROCESS_VM_READ,False,pid[0])
[0082] if process_name.lower()in win32process.GetModuleBaseName(p,0).lower():
[0083] pid_list.append(pid[0])
[0084] win32process.CloseHandle(p)
[0085] except win32gui.error:
[0086] pass
[0087] return pid_list
[0088] # Use 3ds Max process names to get a list of process IDs
[0089] pid_list=get_process_id('3dsmax.exe');
[0090] S24: Traverse all windows and call the callback function:
[0091] Python
[0092] #Traverse all top-level windows
[0093] win32gui.EnumWindows(enum_windows_callback,pid_list);
[0094] S25: Execute the above code: Combine the above code snippets and execute them to obtain all window handles and corresponding process IDs of 3ds Max.
[0095] In this embodiment, the enum_windows_callback function in the above code will print out the window handles and process IDs of all matching process IDs.
[0096] In this embodiment, the win32gui.GetWindowText function is used to obtain the window title, and the win32gui.GetWindowRect function is used to obtain the window size and position.
[0097] In summary, this invention provides a 3ds Max rendering progress acquisition method based on cloud rendering. By executing the method of this invention during the rendering process, the rendering progress of each frame in 3ds Max can be obtained, and the corresponding text file is generated and saved in public storage. In this way, the rendering progress of each frame can be viewed simply by checking the corresponding text file in public storage; thus achieving the effect of freeing up manpower, facilitating convenience and saving time, and solving the shortcomings of the prior art.
[0098] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for obtaining 3ds Max rendering progress based on cloud rendering, characterized in that, Includes the following steps: S1: Get the process ID of 3ds Max; S2: Obtain all real-time windows with process ID S1 using the win32gui module in the third-party Python package win32; S3: Given that the class name of the 3ds Max rendering window is fixed as "#32770", loop through all the real-time windows obtained in S2 and find the window with the class name "#32770" using the win32gui.GetClassName() method; S4: Use win32gui.GetWindowText() to get the following text information from the window: Current Task:Rendering pass 44 (elapsed:M, left:N); S5: Calculate the rendering progress percentage using the text information obtained in S4, as follows: Get the rendered time elapsed:M, and convert M to seconds; Get the estimated remaining rendering time left:N, and convert N to seconds; Calculate percentage progress: (Number of seconds rendered / (Number of seconds rendered + Estimated remaining render seconds)) * 100%; S6: Write the rendering progress percentage calculated in S5 and the rendering progress text information obtained in S4 into the cloud storage progress file; In step S2, the specific steps for obtaining all real-time windows with process ID S1 are as follows: S21: Import the necessary win32gui modules; S22: Define a callback function to iterate through all windows and get their process IDs; S23: Obtain the process ID of 3ds Max: First, you need to find the process ID of 3ds Max; this can be achieved by iterating through all processes in the system. S24: Traverse all windows and call the callback function; S25: Execute steps S21-S24 to obtain all window handles and corresponding process IDs of 3ds Max.
2. The method for obtaining 3ds Max rendering progress based on cloud rendering according to claim 1, characterized in that, Both M and N are in the format of hours.minutes.seconds.
3. The method for obtaining 3ds Max rendering progress based on cloud rendering according to claim 1, characterized in that, Use the `enum_windows_callback` function to print the window handles and process IDs of all matching process IDs.
4. The method for obtaining 3ds Max rendering progress based on cloud rendering according to claim 3, characterized in that, Use the win32gui.GetWindowText function to get the window title, and use the win32gui.GetWindowRect function to get the window size and position.
5. The method for obtaining 3ds Max rendering progress based on cloud rendering according to claim 1, characterized in that, In step S6, the rendering progress of each frame is viewed by checking the progress file in the cloud storage.
Citation Information
Patent Citations
Cloud rendering system without file transmission and method thereof
CN106254489A
3ds Max program exception checking method based on offline rendering cluster environment
CN114860497A