Skip to content

Commit 18be57a

Browse files
committed
Update to Blender 4.1 and RD 1.31
1 parent 5e11aa7 commit 18be57a

File tree

9 files changed

+49
-16
lines changed

9 files changed

+49
-16
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
*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&currency_code=EUR&source=url)
22

3+
**News** As of January 2024, an extra command line option `--disable_direct_composition=1` is recommended to prevent Chrome from restarting the GPU process.
4+
35
**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!
46

57
**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
3638

3739
```
3840
set RENDERDOC_HOOK_EGL=0
39-
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-gpu-sandbox --gpu-startup-dialog
41+
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-gpu-sandbox --gpu-startup-dialog --disable_direct_composition=1
4042
```
4143

4244
3. Do NOT press Ok on the dialog box yet;
@@ -56,7 +58,7 @@ set RENDERDOC_HOOK_EGL=0
5658
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):
5759

5860
```
59-
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"
61+
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"
6062
```
6163

6264
Troubleshooting

blender/MapsModelsImporter/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2019 - 2021 Elie Michel
1+
# Copyright (c) 2019 - 2024 Elie Michel
22
#
33
# Permission is hereby granted, free of charge, to any person obtaining a copy
44
# of this software and associated documentation files (the “Software”), to deal
@@ -24,8 +24,8 @@
2424
bl_info = {
2525
"name": "Maps Models Importer",
2626
"author": "Elie Michel",
27-
"version": (0, 6, 3),
28-
"blender": (3, 1, 0),
27+
"version": (0, 7, 0),
28+
"blender": (4, 1, 0),
2929
"location": "File > Import > Google Maps Capture",
3030
"description": "Import meshes from a Google Maps or Google Earth capture",
3131
"warning": "",
Binary file not shown.
Binary file not shown.
Binary file not shown.

blender/MapsModelsImporter/google_maps.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2019 - 2021 Elie Michel
1+
# Copyright (c) 2019 - 2024 Elie Michel
22
#
33
# Permission is hereby granted, free of charge, to any person obtaining a copy
44
# of this software and associated documentation files (the “Software”), to deal
@@ -214,7 +214,6 @@ def addImageMaterial(name, obj, img):
214214
obj.data.materials.append(mat)
215215
nodes = mat.node_tree.nodes
216216
principled = nodes["Principled BSDF"]
217-
principled.inputs["Specular"].default_value = 0.0
218217
principled.inputs["Roughness"].default_value = 1.0
219218
if img is not None:
220219
texture_node = nodes.new(type="ShaderNodeTexImage")
@@ -223,8 +222,8 @@ def addImageMaterial(name, obj, img):
223222
link = links.new(texture_node.outputs[0], principled.inputs[0])
224223

225224
def numpyLoad(file):
226-
(dim,) = np.fromfile(file, dtype=np.int, count=1)
227-
shape = np.fromfile(file, dtype=np.int, count=dim)
225+
(dim,) = np.fromfile(file, dtype=np.int32, count=1)
226+
shape = np.fromfile(file, dtype=np.int32, count=dim)
228227
dt = np.dtype(file.read(2).decode('ascii'))
229228
array = np.fromfile(file, dtype=dt)
230229
array = array.reshape(shape)

blender/MapsModelsImporter/google_maps_rd.py

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2019 - 2021 Elie Michel
1+
# Copyright (c) 2019 - 2024 Elie Michel
22
#
33
# Permission is hereby granted, free of charge, to any person obtaining a copy
44
# of this software and associated documentation files (the “Software”), to deal
@@ -194,14 +194,14 @@ def extractRelevantCalls(self, drawcalls, _strategy=4):
194194
while True:
195195
skipped_drawcalls, new_min_drawcall = self.findDrawcallBatch(drawcalls[min_drawcall:], first_call, drawcall_prefix, last_call)
196196
if not skipped_drawcalls or self.hasUniform(skipped_drawcalls[0], "_w"):
197-
break
197+
break # Found a good draw call
198198
min_drawcall += new_min_drawcall
199199
else:
200200
print("Error: Could not find the beginning of the relevant 3D draw calls")
201201
return [], "none"
202202

203203
print(f"Trying scraping strategy #{_strategy} (from draw call #{min_drawcall})...")
204-
relevant_drawcalls, _ = self.findDrawcallBatch(
204+
relevant_drawcalls, new_min_drawcall = self.findDrawcallBatch(
205205
drawcalls[min_drawcall:],
206206
first_call,
207207
drawcall_prefix,
@@ -225,6 +225,36 @@ def extractRelevantCalls(self, drawcalls, _strategy=4):
225225
if self.hasUniform(call, "_uMeshToWorldMatrix")
226226
]
227227

228+
if capture_type == "Google Maps":
229+
# Accumulate multiple batches
230+
batch_count = 1
231+
while True:
232+
min_drawcall += new_min_drawcall
233+
# Find a batch
234+
first_call = "" # Try from the beginning on
235+
last_call = "Draw()"
236+
drawcall_prefix = "DrawIndexed"
237+
while True:
238+
skipped_drawcalls, new_min_drawcall = self.findDrawcallBatch(drawcalls[min_drawcall:], first_call, drawcall_prefix, last_call)
239+
if not skipped_drawcalls or self.hasUniform(skipped_drawcalls[0], "_w"):
240+
break # Found a good draw call
241+
min_drawcall += new_min_drawcall
242+
243+
# Accumulate the batch
244+
new_relevant_drawcalls, new_min_drawcall = self.findDrawcallBatch(
245+
drawcalls[min_drawcall:],
246+
first_call,
247+
drawcall_prefix,
248+
last_call)
249+
250+
if not new_relevant_drawcalls:
251+
break
252+
253+
relevant_drawcalls.extend(new_relevant_drawcalls)
254+
batch_count += 1
255+
256+
print(f"Found {batch_count} batches.")
257+
228258
return relevant_drawcalls, capture_type
229259

230260

doc/Building RenderDoc module.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
Get python source code in Python-X.X.X
33
Get embedable release in python-X.X.X-embed-amd64
44
5-
Edit qrenderdoc/pythonXX.natvis
5+
Edit qrenderdoc/pythonXX.natvis by copying the existing pythonYY.natvis and replacing pythonYY by pythonXX everywhere in its content.
66
77
Copy Python-X.X.X\Include\*.h to qrenderdoc\3rdparty\python\include
8+
Copy C:\PythonXX\Include\pyconfig.h to qrenderdoc\3rdparty\python\include, C:\PythonXX being the install path of PythonXX
89
910
Copy python-X.X.X-embed-amd64/pythonXX.zip to qrenderdoc\3rdparty\python
1011
Copy python-X.X.X-embed-amd64/pythonXX.dll and _ctypes.pyd to qrenderdoc\3rdparty\python\x64
@@ -25,11 +26,11 @@ with
2526
pythonXX.lib
2627
(twice)
2728
28-
Copy python310.dll in qrenderdoc\3rdparty\python\x64
2929
Manually run the lines of dll2lib.bat in qrenderdoc\3rdparty\python\x64
3030
31+
Open renderdoc.sln in VisualStudio
3132
Right click on the solution, "Retarget Solution" to your latest
32-
Make sure you build the x64 version, not x86
33+
Make sure you build the x64 version, not x86, Release mode
3334
3435
Build pyrenderdoc_module
3536
Copy x64/Release/renderdoc.dll and x64/Release/pymodules/renderdoc.pyd to MapsModelsImporter/blender/bin/win64

doc/dll2lib.bat

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
REM Set the python version and make shure lib.exe is in the path (e.g. run from the developer command prompt)
2-
set PYTHON_VERSION=python310
2+
set PYTHON_VERSION=python311
33

4+
REM If "dumpbin" is not recognized as a command, run from the developer command prompt
45
dumpbin /EXPORTS %PYTHON_VERSION%.dll > %PYTHON_VERSION%.exports
56

67
echo EXPORTS > %PYTHON_VERSION%.def

0 commit comments

Comments
 (0)