3dsmax rendering progress acquisition method based on cloud rendering
By using Python's win32gui module to parse the window text information of the 3dsMax rendering process, calculate and write it to the cloud storage progress file, the problem of logging in to each machine in the existing technology is solved, and automatic progress acquisition is achieved, reducing manpower operations and improving efficiency.
Patent Information
- Application Number
- CN202411644103.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-11-18
AI Technical Summary
In 3dsMax rendering in large-scale clusters, existing methods require logging into each machine to view the rendering progress of each frame, resulting in cumbersome and waste of manpower.
Through the win32gui module in the third-party package of Python, all real-time windows of the 3dsMax rendering process are obtained, the window text information is parsed to obtain the rendering progress, and calculated and written to the cloud storage progress file.
It realizes the automatic acquisition of 3dsMax image rendering progress, reduces manpower operations, improves efficiency, and solves the problem of wasting manpower in the existing technology.
Smart Images

Figure CN119600168A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of rendering technology, and in particular to a 3dsmax rendering progress acquisition method based on cloud rendering. Background Art
[0002] For large-scale cluster 3dsMax 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 cumbersome and wastes manpower.
[0003] Therefore, the prior art has defects and needs to be improved. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a 3dsmax rendering progress acquisition method based on cloud rendering, which can automatically obtain the progress of image rendering and solve the shortcomings of the existing method such as waste of manpower.
[0005] The technical solution of the present invention is as follows: a method for obtaining 3dsmax rendering progress based on cloud rendering is provided, comprising the following steps.
[0006] S1: Get the process ID of 3dsmax.
[0007] S2: Get all real-time windows of S1 process id through win32gui module in Python third-party package win32.
[0008] S3: Knowing that the class name of the 3dsmax 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" through the win32gui.GetClassName() method.
[0009] S4: Get the following text information in the window through win32gui.GetWindowText(): Current Task: Rendering pass 44 (elapsed: M, left: N).
[0010] S5: Calculate the percentage of rendering progress through the text information obtained in S4. The calculation method is as follows: get the rendered time elapsed: M, convert M into seconds; get the estimated remaining rendering time left: N, convert N into seconds; calculate the percentage progress: the number of seconds rendered / (the number of seconds rendered + the 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, the rendering progress of each frame is checked by checking the progress file in the cloud storage.
[0012] In the present invention, the process ID of 3dsmax is first obtained, and then the real-time window of all the process IDs of 3dsmax is obtained according to the win32gui module in the third-party package win32 of python. The real-time window contains the time that has been rendered and the estimated remaining rendering time. The following text information in the window is obtained through win32gui.GetWindowText(): Current Task: Rendering pass 44 (elapsed: M, left: N), where M is the time that has been rendered, and N is the estimated remaining rendering time; the rendering progress percentage is obtained according to the calculated percentage progress: the number of seconds that have been rendered / (the number of seconds that have been rendered + the estimated remaining rendering seconds) * 100%, and the rendering progress percentage is written into the cloud storage progress file, and the user can view the rendering progress of each frame by viewing the cloud storage progress file. Since the rendering progress of all frames can be viewed in the cloud storage progress file, there is no need for the user to log in to each machine to view the rendering progress of each frame. The present invention can greatly liberate manpower, facilitate time-saving effects, solve the shortcomings of the prior art, and facilitate application.
[0013] Furthermore, both M and N are in the format of hour.minute.second.
[0014] Furthermore, in step S2, the specific steps of obtaining all real-time windows of the S1 process id are:
[0015] S21: Import the necessary win32gui modules:
[0016] Python
[0017] import win32gui
[0018] import win32process;
[0019] S22: Define a callback function to iterate over all windows and get their process IDs:
[0020] Python
[0021] def enum_windows_callback(hwnd,pid_list):
[0022] _,pid=win32process.GetWindowThreadProcessId(hwnd)
[0023] if pid in pid_list:
[0024] win32gui.ShowWindow(hwnd,1)#Optional: Make the window visible
[0025] print(f"Window Handle:{hwnd},Process ID:{pid}");
[0026] S23: Get the process ID of 3ds Max: First, you need to find the process ID of 3ds Max. You can do this by traversing 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 the 3ds Max process name to get the process ID list
[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 of 3ds Max and the corresponding process ID.
[0048] Furthermore, the enum_windows_callback function in the above code prints 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 size and position of the window.
[0050] By adopting the above scheme, the present invention provides a 3dsmax 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 3dsmax is obtained, and a corresponding text file is generated and saved in a public storage. In this way, the rendering progress of each frame can be viewed by only viewing the corresponding text file in the public storage; the effect of liberating manpower, facilitating time saving, and solving the shortcomings of the prior art is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 The figure is a flow chart of the method of the present invention. DETAILED DESCRIPTION
[0052] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0053] See also Figure 1 The present invention provides a method for obtaining 3dsmax rendering progress based on cloud rendering, comprising the following steps.
[0054] S1: Get the process ID of 3dsmax.
[0055] S2: Get all real-time windows of S1 process id through win32gui module in Python third-party package win32.
[0056] S3: Knowing that the class name of the 3dsmax 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" through the win32gui.GetClassName() method.
[0057] S4: Get the following text information in the window through win32gui.GetWindowText(): Current Task: Rendering pass 44 (elapsed: M (for example, 2:51:13), left: N (for example, 0:12:36)).
[0058] S5: Calculate the percentage of rendering progress through the text information obtained in S4, and the calculation method is as follows: get the rendered time elapsed: 2:51:13, convert it into seconds 2*60*60+51*60+13=10273s; get the estimated remaining rendering time left: 0:12:36, convert it into seconds 0*60*60+12*60+36=756s; calculate the percentage progress: the number of seconds rendered / (the number of seconds rendered+the estimated remaining rendering seconds)*100; the calculation is as follows 10273 / (10273+756)*100%=93%; 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, the rendering progress of each frame is checked by checking the progress file in the cloud storage.
[0060] In this embodiment, M and N are both in the format of hour.minute.second.
[0061] In this embodiment, in step S2, the specific steps of obtaining all real-time windows of the S1 process id are:
[0062] S21: Import the necessary win32gui modules:
[0063] Python
[0064] import win32gui
[0065] import win32process;
[0066] S22: Define a callback function to iterate over all windows and get their process IDs:
[0067] Python
[0068] def enum_windows_callback(hwnd,pid_list):
[0069] _,pid=win32process.GetWindowThreadProcessId(hwnd)
[0070] if pid in pid_list:
[0071] win32gui.ShowWindow(hwnd,1)#Optional: Make the window visible
[0072] print(f"Window Handle:{hwnd},Process ID:{pid}");
[0073] S23: Get the process ID of 3ds Max: First, you need to find the process ID of 3ds Max. You can do this by traversing 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 the 3ds Max process name to get the process ID list
[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 of 3ds Max and the corresponding process ID.
[0095] In this embodiment, the enum_windows_callback function in the above code prints 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 size and position of the window.
[0097] In summary, the present invention provides a 3dsmax 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 3dsmax is obtained, and a corresponding text file is generated and saved in a public storage. In this way, the rendering progress of each frame can be viewed by only viewing the corresponding text file in the public storage. The effect of liberating manpower, facilitating time saving, and solving the shortcomings of the prior art is achieved.
[0098] The above are only 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 in the protection scope of the present invention.
Claims
1. A method for obtaining 3dsmax rendering progress based on cloud rendering, characterized in that: The following steps are involved: S1: Get the process id of 3dsmax; S2: Get all real-time windows of S1 process id through win32gui module in python third-party package win32; S3: Knowing that the class name of the 3dsmax 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" through the win32gui.GetClassName() method; S4: Get the following text information in the window through win32gui.GetWindowText(): Current Task: Rendering pass 44 (elapsed: M, left: N); 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 into seconds; Get the estimated remaining rendering time left: N and convert N into seconds; Calculate the percentage progress: the number of seconds rendered / (the number of seconds rendered + the estimated remaining rendering 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.
2. The method for obtaining 3dsmax rendering progress based on cloud rendering according to claim 1, characterized in that: The M and N are both in the format of hour.minute.second.
3. The method for obtaining 3dsmax rendering progress based on cloud rendering according to claim 1, characterized in that: In step S2, the specific steps of obtaining all real-time windows of the S1 process id are: S21: Import the necessary win32gui modules: Python import win32gui import win32process; S22: Define a callback function to iterate over all windows and get their process IDs: Python def enum_windows_callback(hwnd,pid_list): _,pid=win32process.GetWindowThreadProcessId(hwnd) if pid in pid_list: win32gui.ShowWindow(hwnd,1)#Optional: Make the window visible print(f"Window Handle:{hwnd},Process ID:{pid}"); S23: Get the process ID of 3ds Max: First, you need to find the process ID of 3ds Max. You can do this by traversing all processes in the system: Python def get_process_id(process_name): pid_list = [] win32gui.EnumProcesses(None,0,win32gui.LIST_SYSTEM_PROCESSES) for pid in win32gui.GetProcessList(): try: p=win32process.OpenProcess(win32con.PROCESS_QUERY_INFORMATION|win32con.PROCESS_VM_READ,False,pid[0]) if process_name.lower()in win32process.GetModuleBaseName(p,0).lower(): pid_list.append(pid[0]) win32process.CloseHandle(p) except win32gui.error: pass return pid_list #Use the 3ds Max process name to get the process ID list pid_list=get_process_id('3dsmax.exe'); S24: Traverse all windows and call the callback function: Python #Traverse all top-level windows win32gui.EnumWindows(enum_windows_callback,pid_list); S25: Execute the above code: Combine the above code snippets and execute them to obtain all window handles of 3ds Max and the corresponding process ID.
4. The method for obtaining 3dsmax rendering progress based on cloud rendering according to claim 3, characterized in that: The enum_windows_callback function in the above code prints out the window handles and process IDs of all matching process IDs.
5. The method for obtaining 3dsmax rendering progress based on cloud rendering according to claim 4, 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.
6. The method for obtaining 3dsmax rendering progress based on cloud rendering according to claim 1, characterized in that: In step S6, the rendering progress of each frame is checked by checking the progress file stored in the cloud.
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
Video synthesis method and device based on template, equipment and storage medium
CN115883875A
Method and apparatus for providing detailed progress indicators
US20120304098A1