Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ashawkey committed Aug 14, 2023
1 parent 3be803a commit f3cd3ce
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 43 deletions.
34 changes: 33 additions & 1 deletion docs/model/blender_script.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,38 @@
# blender script

### locate objects
logs are printed to the terminal console, use `window --> toggle system console` to open it.

### auto import many objects

assume you have a folder with lots of obj models (each in a sub-folder):

```python
import bpy
import os

context = bpy.context
dir = r"C:\Users\hawke\Downloads\bear"

obj_dirs = os.listdir(dir)

for i, name in enumerate(obj_dirs):
obj_dir = os.path.join(dir, name)
files = os.listdir(obj_dir)
for file in files:
if not file.endswith('.obj'): continue
path = os.path.join(obj_dir, file)

print(f'[INFO] {i} process {file}')

bpy.ops.import_scene.obj(filepath=path, filter_glob="*.obj;*.mtl;*.png") # also load png textures
obj = context.selected_objects[0]

# location (10 in a row)
h, w = i % 10 - 5, i // 10 - 5
obj.location = (h, w, 0)
```

### locate objects in current scene

```python
import bpy
Expand Down
6 changes: 6 additions & 0 deletions docs/model/blender_tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
* You could see in Outlier, the camera/light now belongs to the empty object.
* Rotate the empty object, and the child will rotate too!

### animation interpolation

default is some smoothing bezier curve.

In Animation pannel, choose `channel --> extrapolation mode --> linear extrapolation`.

### Render

`0` to toggle camera view.
Expand Down
67 changes: 25 additions & 42 deletions docs/web/proxy/set_usual_apps_proxy.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,33 @@
# use proxy


Prefer setting globally (bash, powershell) rather than setting each individual program...

### find the right port !!!

* Windows

​ trojan-qt5 local client's socks port is in "入站设置", not "出站设置".

​ the default is `socks5://127.0.0.1:51837 `
clash defaults to `http://127.0.0.1:7890` and `socks5://127.0.0.1:7890`

* Ubuntu
trojan-qt5 local client's socks port is in "入站设置", not "出站设置". the default is `socks5://127.0.0.1:51837`.

trojan client's default is `socks5://127.0.0.1:1080`



### git
### powershell

```bash
# set (do not need to set https.proxy!)
git config --global http.proxy socks5://127.0.0.1:51837
```powershell
# set
$Env:http_proxy="http://127.0.0.1:7890"
$Env:https_proxy="http://127.0.0.1:7890"
# unset
git config --global --unset http.proxy
$Env:http_proxy=""
$Env:https_proxy=""
# show
git config --global http.proxy
# show
echo $Env:http_proxy
echo $Env:https_proxy
```



### bash

```bash
Expand All @@ -50,6 +47,18 @@ echo $http_proxy
echo $https_proxy
```

### git

```bash
# set (do not need to set https.proxy!)
git config --global http.proxy socks5://127.0.0.1:51837

# unset
git config --global --unset http.proxy

# show
git config --global http.proxy
```


### pip
Expand All @@ -66,32 +75,6 @@ pip install pysocks





### powershell

tested:

```powershell
setx http_proxy socks5://127.0.0.1:51837
setx https_proxy socks5://127.0.0.1:51837
```

not tested:

```powershell
# set
netsh winhttp set proxy "192.168.0.14:3128"
# unset
netsh winhttp reset proxy
# show
netsh winhttp show proxy
```



### docker

* `docker build`
Expand Down
18 changes: 18 additions & 0 deletions docs/windows/powershell.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
## powershell

### set execution policy
The default is `restricted`, which disables executing custom ps scripts (ps1 files).
Run powershell in administrator mode (ctrl + click new terminal), then:
```powershell
set-executionpolicy remotesigned
# check
get-executionpolicy # show remotesigned
```


### profile (bashrc)
Expand All @@ -8,6 +17,7 @@
# location
$profile
# C:\Users\haw\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
# if it doesn't exist, you need to create it manually...
# edit it
notepad $profile
Expand Down Expand Up @@ -55,3 +65,11 @@ reload:
. $profile
```

### set proxy via profile
Add in your `$profile`:
```powershell
# example for clash default port
$Env:http_proxy="http://127.0.0.1:7890"
$Env:https_proxy="http://127.0.0.1:7890"
```

0 comments on commit f3cd3ce

Please sign in to comment.