diff --git a/README.md b/README.md index 92f484a..aa4eefe 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ *If this helps you save time or money for your job, please consider supporting the work involved in here ;)* [![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=DNEEF8GDX2EV6¤cy_code=EUR&source=url) +**News** As of January 2024, an extra command line option `--disable_direct_composition=1` is recommended to prevent Chrome from restarting the GPU process. + **News** As of January 2023, Only versions older or equal to 0.5.0 no longer work because the associated version of RenderDoc are no longer able to inject into Chrome. Use version 0.6.0 (for RenderDoc 1.25 and Blender 3.4) or newer! **News** As of Aug 23, 2020, [**Google Earth** web](https://earth.google.com/web/) is now supported on top of Google Maps! @@ -36,7 +38,7 @@ You can follow instruction from the walkthrough video: https://youtu.be/X6Q7dbtX ``` set RENDERDOC_HOOK_EGL=0 -"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-gpu-sandbox --gpu-startup-dialog +"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-gpu-sandbox --gpu-startup-dialog --disable_direct_composition=1 ``` 3. Do NOT press Ok on the dialog box yet; @@ -56,7 +58,7 @@ set RENDERDOC_HOOK_EGL=0 For step 2. you can create a link to Chrome rather than usig the cmd, and put as target (again, adapt the path to `chrome.exe` to your installation): ``` -C:\Windows\System32\cmd.exe /c "SET RENDERDOC_HOOK_EGL=0 && START "" ^"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe^" --disable-gpu-sandbox --gpu-startup-dialog" +C:\Windows\System32\cmd.exe /c "SET RENDERDOC_HOOK_EGL=0 && START "" ^"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe^" --disable-gpu-sandbox --gpu-startup-dialog --disable_direct_composition=1" ``` Troubleshooting diff --git a/blender/MapsModelsImporter/__init__.py b/blender/MapsModelsImporter/__init__.py index 452f71c..fe7a7ba 100644 --- a/blender/MapsModelsImporter/__init__.py +++ b/blender/MapsModelsImporter/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019 - 2021 Elie Michel +# Copyright (c) 2019 - 2024 Elie Michel # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the “Software”), to deal @@ -24,8 +24,8 @@ bl_info = { "name": "Maps Models Importer", "author": "Elie Michel", - "version": (0, 6, 3), - "blender": (3, 1, 0), + "version": (0, 7, 0), + "blender": (4, 1, 0), "location": "File > Import > Google Maps Capture", "description": "Import meshes from a Google Maps or Google Earth capture", "warning": "", diff --git a/blender/MapsModelsImporter/bin/win64/d3dcompiler_47.dll b/blender/MapsModelsImporter/bin/win64/d3dcompiler_47.dll new file mode 100644 index 0000000..80489b8 Binary files /dev/null and b/blender/MapsModelsImporter/bin/win64/d3dcompiler_47.dll differ diff --git a/blender/MapsModelsImporter/bin/win64/renderdoc.dll b/blender/MapsModelsImporter/bin/win64/renderdoc.dll index 4fe5ce5..c2d5061 100644 Binary files a/blender/MapsModelsImporter/bin/win64/renderdoc.dll and b/blender/MapsModelsImporter/bin/win64/renderdoc.dll differ diff --git a/blender/MapsModelsImporter/bin/win64/renderdoc.pyd b/blender/MapsModelsImporter/bin/win64/renderdoc.pyd index 2772b3b..f89b2ea 100644 Binary files a/blender/MapsModelsImporter/bin/win64/renderdoc.pyd and b/blender/MapsModelsImporter/bin/win64/renderdoc.pyd differ diff --git a/blender/MapsModelsImporter/google_maps.py b/blender/MapsModelsImporter/google_maps.py index 7a7053f..834284d 100644 --- a/blender/MapsModelsImporter/google_maps.py +++ b/blender/MapsModelsImporter/google_maps.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019 - 2021 Elie Michel +# Copyright (c) 2019 - 2024 Elie Michel # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the “Software”), to deal @@ -214,7 +214,6 @@ def addImageMaterial(name, obj, img): obj.data.materials.append(mat) nodes = mat.node_tree.nodes principled = nodes["Principled BSDF"] - principled.inputs["Specular"].default_value = 0.0 principled.inputs["Roughness"].default_value = 1.0 if img is not None: texture_node = nodes.new(type="ShaderNodeTexImage") @@ -223,8 +222,8 @@ def addImageMaterial(name, obj, img): link = links.new(texture_node.outputs[0], principled.inputs[0]) def numpyLoad(file): - (dim,) = np.fromfile(file, dtype=np.int, count=1) - shape = np.fromfile(file, dtype=np.int, count=dim) + (dim,) = np.fromfile(file, dtype=np.int32, count=1) + shape = np.fromfile(file, dtype=np.int32, count=dim) dt = np.dtype(file.read(2).decode('ascii')) array = np.fromfile(file, dtype=dt) array = array.reshape(shape) diff --git a/blender/MapsModelsImporter/google_maps_rd.py b/blender/MapsModelsImporter/google_maps_rd.py index 0da48a6..ace60c8 100644 --- a/blender/MapsModelsImporter/google_maps_rd.py +++ b/blender/MapsModelsImporter/google_maps_rd.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019 - 2021 Elie Michel +# Copyright (c) 2019 - 2024 Elie Michel # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the “Software”), to deal @@ -194,14 +194,14 @@ def extractRelevantCalls(self, drawcalls, _strategy=4): while True: skipped_drawcalls, new_min_drawcall = self.findDrawcallBatch(drawcalls[min_drawcall:], first_call, drawcall_prefix, last_call) if not skipped_drawcalls or self.hasUniform(skipped_drawcalls[0], "_w"): - break + break # Found a good draw call min_drawcall += new_min_drawcall else: print("Error: Could not find the beginning of the relevant 3D draw calls") return [], "none" print(f"Trying scraping strategy #{_strategy} (from draw call #{min_drawcall})...") - relevant_drawcalls, _ = self.findDrawcallBatch( + relevant_drawcalls, new_min_drawcall = self.findDrawcallBatch( drawcalls[min_drawcall:], first_call, drawcall_prefix, @@ -225,6 +225,36 @@ def extractRelevantCalls(self, drawcalls, _strategy=4): if self.hasUniform(call, "_uMeshToWorldMatrix") ] + if capture_type == "Google Maps": + # Accumulate multiple batches + batch_count = 1 + while True: + min_drawcall += new_min_drawcall + # Find a batch + first_call = "" # Try from the beginning on + last_call = "Draw()" + drawcall_prefix = "DrawIndexed" + while True: + skipped_drawcalls, new_min_drawcall = self.findDrawcallBatch(drawcalls[min_drawcall:], first_call, drawcall_prefix, last_call) + if not skipped_drawcalls or self.hasUniform(skipped_drawcalls[0], "_w"): + break # Found a good draw call + min_drawcall += new_min_drawcall + + # Accumulate the batch + new_relevant_drawcalls, new_min_drawcall = self.findDrawcallBatch( + drawcalls[min_drawcall:], + first_call, + drawcall_prefix, + last_call) + + if not new_relevant_drawcalls: + break + + relevant_drawcalls.extend(new_relevant_drawcalls) + batch_count += 1 + + print(f"Found {batch_count} batches.") + return relevant_drawcalls, capture_type diff --git a/doc/Building RenderDoc module.md b/doc/Building RenderDoc module.md index edf729e..70517df 100644 --- a/doc/Building RenderDoc module.md +++ b/doc/Building RenderDoc module.md @@ -2,9 +2,10 @@ Get python source code in Python-X.X.X Get embedable release in python-X.X.X-embed-amd64 -Edit qrenderdoc/pythonXX.natvis +Edit qrenderdoc/pythonXX.natvis by copying the existing pythonYY.natvis and replacing pythonYY by pythonXX everywhere in its content. Copy Python-X.X.X\Include\*.h to qrenderdoc\3rdparty\python\include +Copy C:\PythonXX\Include\pyconfig.h to qrenderdoc\3rdparty\python\include, C:\PythonXX being the install path of PythonXX Copy python-X.X.X-embed-amd64/pythonXX.zip to qrenderdoc\3rdparty\python Copy python-X.X.X-embed-amd64/pythonXX.dll and _ctypes.pyd to qrenderdoc\3rdparty\python\x64 @@ -25,11 +26,11 @@ with pythonXX.lib (twice) -Copy python310.dll in qrenderdoc\3rdparty\python\x64 Manually run the lines of dll2lib.bat in qrenderdoc\3rdparty\python\x64 +Open renderdoc.sln in VisualStudio Right click on the solution, "Retarget Solution" to your latest -Make sure you build the x64 version, not x86 +Make sure you build the x64 version, not x86, Release mode Build pyrenderdoc_module Copy x64/Release/renderdoc.dll and x64/Release/pymodules/renderdoc.pyd to MapsModelsImporter/blender/bin/win64 diff --git a/doc/dll2lib.bat b/doc/dll2lib.bat index 4c8c7b9..cd118a5 100644 --- a/doc/dll2lib.bat +++ b/doc/dll2lib.bat @@ -1,6 +1,7 @@ REM Set the python version and make shure lib.exe is in the path (e.g. run from the developer command prompt) -set PYTHON_VERSION=python310 +set PYTHON_VERSION=python311 +REM If "dumpbin" is not recognized as a command, run from the developer command prompt dumpbin /EXPORTS %PYTHON_VERSION%.dll > %PYTHON_VERSION%.exports echo EXPORTS > %PYTHON_VERSION%.def