Hello @dunhou,
Thank you for the updated information. So, I spoke with the developer and did some digging.
Technical Overview
First of all, I provided some slightly outdated information. Since the reimplementation of the HTML browser, it does not share the cache with the system default browser anymore, and there are now also two Browser types which can kick in, depending on your environment:
- The new
Chromium
HTML Rendering Engine of Windows 10+ as the new default (the Cinema 4D installer will install the required WebView2 dependencies even on older versions of Win10 which used EdgeHtml
)
- The old Trident, i.e. Internet Explorer, HTML Rendering engine of older Windows engines as a fallback.
The cache of our HTML gadget is stored under \{user}\AppData\Roaming\MAXON\{c4d version}\EBWebView
. You can also force Cinema 4D to use the old engine by passing the startup augment -g_forceedge=false
, e.g., C:\Program Files\Maxon\S26_107>"Cinema 4D.exe" -g_forceedge=false
. When running Cinema 4D you can distinguish the internally used HTML engine easily by their context menu.
The context menu of the HTML gadget in the Quickstart dialog of S26.107 running in legacy browser mode with "Cinema 4D.exe" -g_forceedge=false

The context menu of the HTML gadget in the Quickstart dialog of S26.107 running in default browser mode with "Cinema 4D.exe"
, i.e., "Cinema 4D.exe" -g_forceedge=true

Your Problem
- I still cannot reproduce your problem. Your Windows 10 version seems recent enough. I am on Windows 11 though (latest build at the pointing of writing this).
- Our developer pointed out that your screenshot, especially its scrolls bars, look a bit like you are running in legacy mode, i.e., on Trident.
- The form how you provided the example, as a Script Manager script, is inherently not supported by the HTML gadget, because the browser instance attaches itself internally to a window handle (
HWND
). It is therefore important to pass in a plugin id on GeDaialog.Open
.
Solutions
I have provided below a conformant CommandData
bound solution, could you please check if the issue is reproducible with this variant? When this does not fix your problem, could please also check the following:
- Via the trick of the context menu 'look', could you please figure out if your Cinema 4D HTML gadget runs on Trident or Chormium?
- Try to start Cinema 4D with
-g_forceedge=false
and -g_forceedge=true
and check if:
a. -g_forceedge=true
indeed will use Edge(Chromium),
b. if either of these flags will resolve the problem.
- I still would not rule out that you somehow screwed up your browser cache. When the problem persists, please delete
\{user}\AppData\Roaming\MAXON\{c4d version}\EBWebView
.
I will at least update the Python docs to indicate more clearly in c4d.gui.HtmlViewerCustomGui that this gadget is not supported in asynchronous dangling dialogs opened in the Script Manager.
Cheers,
Ferdinand
The code:
"""Provides a simple example for a browser control in a dialog hosted by a CommandData plugin.
The important caveats are here:
1. CUSTOMGUI_HTMLVIEWER only supports asynchronous dialogs.
2. Which by extension means that CUSTOMGUI_HTMLVIEWER is not supported in Script Manager scripts.
You must save this file as a pyp plugin file in your plugin folder of choice.
"""
import c4d
class HtmlDialog(c4d.gui.GeDialog):
"""A dialog with the HTML gadget in it.
"""
URL_DEFAULT: str = r"https://www.baidu.com"
ID_GDT_URLBAR: int = 1000
ID_GDT_BROWSER: int = 1001
def CreateLayout(self):
"""Called by Cinema 4D to populate the dialog with gadgets.
"""
self.SetTitle("Web Browser")
self.GroupBegin(0, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, 1)
self.GroupSpace(5, 5)
self.GroupBorderSpace(5, 5, 5, 5)
self.AddEditText(HtmlDialog.ID_GDT_URLBAR, c4d.BFH_SCALEFIT)
self.htmlView = self.AddCustomGui(HtmlDialog.ID_GDT_BROWSER, c4d.CUSTOMGUI_HTMLVIEWER, "",
c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, 200, 200, c4d.BaseContainer())
if not isinstance(self.htmlView, c4d.gui.BaseCustomGui):
return False
self.GroupEnd()
return True
def InitValues(self):
"""Init the dialog values after CreateLayout().
"""
self.SetString(HtmlDialog.ID_GDT_URLBAR, HtmlDialog.URL_DEFAULT)
self.htmlView.SetUrl(HtmlDialog.URL_DEFAULT, c4d.URL_ENCODING_UTF16)
return True
def Command(self, wid, bc):
"""React to input events in the dialog.
"""
if wid == c4d.DLG_OK: # Enter pressed
url: str = self.GetString(HtmlDialog.ID_GDT_URLBAR)
if url is not None:
self.htmlView.SetUrl(url, c4d.URL_ENCODING_UTF16)
return True
class HtmlDialogCommand(c4d.plugins.CommandData):
"""Opens the HTML gadget dialog.
"""
ID_PLUGIN: int = 1060020
def __init__(self) -> None:
"""Initialize the dialog property of the command.
"""
self._dialog = None
@property
def Dialog (self) -> HtmlDialog:
"""Returns the dialog of the command instance.
"""
if self._dialog is None:
self._dialog = HtmlDialog()
return self._dialog
def Execute(self, doc: c4d.documents.BaseDocument) -> bool:
"""Opens the HTML dialog of the command.
"""
self.Dialog.Open(c4d.DLG_TYPE_ASYNC, HtmlDialogCommand.ID_PLUGIN, defaultw=500, defaulth=500)
return True
def RestoreLayout(self, secret: object) -> bool:
"""Restores the HTML dialog on layout changes.
"""
return self.Dialog.Restore(HtmlDialogCommand.ID_PLUGIN, secret)
if __name__ == '__main__':
c4d.plugins.RegisterCommandPlugin(
id=HtmlDialogCommand.ID_PLUGIN,
str="PC14180 (GeDialog HTML gadget)",
info=c4d.PLUGINFLAG_SMALLNODE,
icon=None,
help="PC14180",
dat=HtmlDialogCommand())