@Dunhou
Thank you for your help, but after I run the following code, the Redshift Settings have not changed
By the way I am a python novice and the above code is written by GPT
I just want to use the script to change the Settings of the image below
R
Latest posts made by RTF
-
RE: python script change Redshift setting
-
python script change Redshift setting
I want to write a script to set the Settings of Redshift Matpreview
Butimport c4d import c4d.documents import redshift import os def FindVideoPost(renderData, pluginId): vp = renderData.GetFirstVideoPost() while vp is not None: if vp.IsInstanceOf(pluginId): return vp vp = vp.GetNext() return None def FindAddVideoPost(renderData, vpPluginID): vp = FindVideoPost(renderData, vpPluginID) if vp is None: vp = c4d.documents.BaseVideoPost(vpPluginID) if vp is not None: renderData.InsertVideoPost(vp) return vp def main(): doc = c4d.documents.GetActiveDocument() renderdata = doc.GetActiveRenderData() vprs = FindAddVideoPost(renderdata, redshift.VPrsrenderer) if vprs is None: return # Switch renderer renderdata[c4d.RDATA_RENDERENGINE] = redshift.VPrsrenderer # Set Redshift render parameters vprs[c4d.PREFS_REDSHIFT_MATPREVIEW_MODE] = 1 # Refresh UI c4d.EventAdd() # print("Render settings updated to 4K and frame range set to All Frames.") # Execute the main function if __name__=='__main__': main()
vprs[c4d.PREFS_REDSHIFT_MATPREVIEW_MODE] = 1
This code doesn't seem to have any effectThen I changed the method and set the code in C4D
import c4d from c4d import gui def set_amlimit_preference(): # 获取全局设置容器 bc = c4d.GetWorldContainerInstance() # 设置新的值为 666 bc[c4d.PREFS_REDSHIFT_MATPREVIEW_MODE] = 1 # 应用修改后的设置 c4d.SetWorldContainer(bc) # 保存设置到磁盘 c4d.SaveWorldPreferences() # 尝试刷新界面 c4d.EventAdd() # 运行函数 if __name__ == '__main__': set_amlimit_preference()
Can not be modified successfully
Can someone help me