上岸的鱼

心中有光,便可使整个世界升起太阳

代码如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108

#!/bin/bash

# ====== 配置路径 ======
source_folder="$HOME/Library/Obsidian/1-blog"
destination_folder="$HOME/blog/source/_posts"
image_folder="$HOME/Library/blog/source/images"
hexo_root="$HOME/Library/blog"
log_file="$hexo_root/deploy.log"

# ====== 参数处理 ======
PREVIEW=false
BACKUP=false
for arg in "$@"; do
case $arg in
--preview) PREVIEW=true ;;
--backup) BACKUP=true ;;
esac
done

# ====== 日志函数 ======
log() {
echo "[$(date +'%Y-%m-%d %H:%M:%S')] $*" | tee -a "$log_file"
}

# ====== 检查 SSH 连接 ======
log "🔐 检查 GitHub SSH 连接..."
if ! ssh -T [email protected] 2>&1 | grep -q "successfully authenticated"; then
log "❌ SSH 未配置或连接失败!请先配置 GitHub SSH key:https://github.com/settings/keys"
exit 1
fi
log "✅ SSH 连接正常"

# ====== 可选备份 ======
if $BACKUP; then
backup_zip="$HOME/Desktop/1-blog-backup_$(date +'%Y%m%d-%H%M%S').zip"
log "🗃️ 正在备份 Obsidian 博客目录..."
zip -r "$backup_zip" "$source_folder" >/dev/null
log "✅ 已备份到桌面:$backup_zip"
fi

# ====== 确保目录存在 ======
mkdir -p "$destination_folder"
mkdir -p "$image_folder"

# ====== 增量同步 Markdown 和图片文件 ======
log "📥 增量同步 Markdown 和图片..."
rsync -av --include="*/" \
--include="*.md" \
--include="*.png" \
--include="*.jpg" \
--include="*.jpeg" \
--include="*.gif" \
--include="*.svg" \
--include="*.webp" \
--exclude="*" \
"$source_folder"/ "$destination_folder"/

# ====== 替换图片语法 & 拷贝图片 ======
log "🛠 替换 Obsidian 图片语法,并复制图片..."

find "$destination_folder" -name "*.md" | while read -r mdfile; do
rel_md_path="${mdfile#$destination_folder/}"
original_md="$source_folder/$rel_md_path"
original_md_dir=$(dirname "$original_md")

# 查找 Obsidian 图片语法
perl -nle 'print $1 while /\!\[\[\s*(.*?)\s*\]\]/g' "$mdfile" | while read -r relimg; do
imgname=$(basename "$relimg")
src_img="$original_md_dir/$relimg"
dest_img="$image_folder/$imgname"

if [[ -f "$src_img" ]]; then
# 增量复制
if [[ ! -f "$dest_img" ]]; then
cp "$src_img" "$dest_img"
log "🖼 已复制图片: $src_img -> $dest_img"
fi
else
log "⚠️ 图片未找到: $src_img"
fi
done

# 替换 Obsidian 语法为 Hexo 路径
perl -i -pe 's/\!\[\[\s*(.*?)\s*\]\]/![]\(\/images\/\1\)/g' "$mdfile"
perl -i -pe 's/\/images\/.*\/([^\/]+\.(png|jpg|jpeg|gif|svg|webp))/\/images\/$1/g' "$mdfile"
done

log "✅ 图片路径修复完成"

# ====== Hexo 构建或预览 ======
cd "$hexo_root" || { log "❌ Hexo 根目录不存在"; exit 1; }

log "🧹 Hexo 清理 & 生成中..."
hexo clean && hexo generate

if $PREVIEW; then
log "🌐 启动本地预览..."
hexo server &
sleep 2
open "http://localhost:4000"
log "✅ 浏览器已打开本地预览"
else
log "🚀 正在部署 Hexo 博客..."
hexo deploy && log "✅ 部署完成"
fi


Unreal Engine 5:Nanite 与 Fracture 不兼容问题总结

在使用 Chaos Fracture 进行物体破坏时,如果出现以下问题:

  • 看不到碎片(Exploded View 无效)
  • 模拟或运行时无法破碎
  • 碎片无法参与物理模拟

很可能是因为你的模型启用了 Nanite

❗ 问题原因

Nanite 不支持运行时的网格拓扑变形,和 Chaos Fracture 系统不兼容。> “Nanite meshes cannot be fractured as the data representation is not compatible with Chaos destruction.” —— 官方论坛讨论原帖

✅ 解决方法

  1. 找到原始 Static Mesh
  2. 右键关闭 Nanite
  3. 保存并重新创建 Geometry Collection

📌 提示

  • 启用了 Nanite 的模型在资源图标上有绿色闪电标志 ⚡
  • 关闭 Nanite 后必须重新创建 GC,旧的无效

🧠 总结表

项目 是否支持
Nanite 支持高效渲染 ✅ 支持
Nanite Mesh 支持 Fracture ❌ 不支持
正确做法:关闭 Nanite 再破碎 ✅ 推荐

记住一句话:要做破碎,先关 Nanite

🪴 UE5 草不显示问题排查记录(Mac mini + 5.5.4)

最近在用 Unreal Engine 5.5.4 做地形,想用 LandscapeGrassOutput 实现图层驱动自动刷草。
材质节点、LandscapeGrassType、图层权重、Layer Info 都设置好了,图层也确实涂上了。

但草就是不显示。

我试了常规操作:

  • 材质和图层名一致 ✅
  • GrassType 绑定 ✅
  • 图层有绘制 ✅
  • 控制台尝试过:
    r.Grass.Enable 1  
    grass.flushcache  
    dumpgrassmaps
    

全都没效果。

💡 真正的原因
后来发现,是因为引擎当前处于 “Low” 性能模式。

在 Low 模式下,Unreal 会自动把 r.Grass.Enable 设为 0,
即使控制台强制开启也会被下一帧覆盖。

我把引擎切到 High 或 Epic 模式后,草立刻刷出来了。

💻 补充:Mac 上使用 UE 的一些坑
我是在 Mac mini 上开发的,草系统这种依赖 GPU 实例化的功能
在 macOS + Metal 渲染器下表现经常不稳定。

一些注意事项:

GrassOutput 有时完全无效(尤其配合 Nanite Mesh)

r.Grass.Enable 可能被忽略或不响应

PCG 效果更可靠(推荐用于 Mac 项目)

✅ 总结
如果你遇到 GrassOutput 不显示的问题:

❓ 检查是不是 Low 模式

✅ 设置 r.Grass.Enable=1(最好通过 .ini)

⚠️ 在 Mac 上开发需特别小心 Grass 系统兼容性

一句话总结:
UE 的 Low 模式默认禁用草系统,macOS 上更容易中招。别急着改材质,先调高性能档位。

1.data文件夹中的文件

https://github.com/pandora-next/deploy
下载data文件夹,并配置tokens.json中的token

在需要授权的服务器上,执行以下命令获取授权:

curl -fLO “https://dash.pandoranext.com/data/p3ryYsxo9sYn0Me87jyUhfHhIGH1C2LTaO7oBQ6xs3M/license.jwt

或者

curl -fL “https://dash.pandoranext.com/data/p3ryYsxo9sYn0Me87jyUhfHhIGH1C2LTaO7oBQ6xs3M/license.jwt” > license.jwt

然后将license.jwt放到data中

2.docker-compose.yml配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
   
version: '3'

services:

  pandora-next:

    image: pengzhile/pandora-next

    container_name: PandoraNext

    restart: always

    ports:

      - 8091:8181

    volumes:

      - ./data:/data

启动docker:
docker-compose up -d

NGINX文件位置和生效办法

NGINX 的配置文件通常位于 /etc/nginx/ 目录中。主配置文件通常命名为 nginx.conf

你可以使用 NGINX 的命令行工具来检查配置文件的语法是否正确,并重启 NGINX 以使更改生效。

  1. 检查配置文件的语法:

    1
    sudo nginx -t

    如果配置文件没有问题,你将看到类似的输出表示语法是 OK 的。

  2. 如果配置检查通过,可以通过以下命令重启 NGINX 使配置生效:

    1
    sudo systemctl restart nginx

    或者

    1
    sudo service nginx restart

    这取决于你的系统和你的权限设置。

确保你有适当的权限执行这些命令,可能需要使用 sudo

NGINX的配置

根据您提供的网页,以下是通过NGINX反向代理实现Cloud模式TOKEN免登录访问的操作步骤:

  1. 部署好Cloud模式后,配置NGINX反向代理,添加以下代码:
1
add_header Set-Cookie "access-token=你的Access Token; Path=/; SameSite=None; Secure";
  1. 替换“你的Access Token”为实际的Access Token。
  2. 访问域名,通过NGINX载入Access Token。
  3. 如首次访问跳转至/auth/login页面,需返回主域名。
  4. 通过sub_filter插入JS解决,添加以下代码:
1
2
3
proxy_set_header Accept-Encoding "";
sub_filter '</head>' '<script src="https://你的JS地址/pandora.js"></script></head>';
sub_filter_once off;
  1. 将pandora.js文件放至公网可访问位置,修改JS文件地址。
  2. 在pandora.js中添加重定向规则,如下:
1
2
3
4
5
6
window.onload = function() {
var currentUrl = window.location.href;
if (currentUrl === "https://pandora.域名/auth/login") {
window.location.href = "https://pandora.域名/";
}
};

更多细节可参考原网页https://github.com/zhile-io/pandora/issues/171。

0%