blender <2> 修改器

1. 表面细分

选中物体添加修改器,添加表面细分修改器。
表面细分可以配合工具栏->工具中的着色方式(光滑、平直)使用。

快捷键:选中物体按“CTRL+数字键”直接添加表面细分器,数字代表了细分的次数。

 

2. 镜射

编辑模式:
切分后线框模式下按B框选可以选择背后的边。按X删除顶点。添加镜射修改器,根据XYZ轴选择镜射。

(在进行镜射的时候,要先删除)

勾选镜射修改器的范围限制可以防止交界处分离或者越界。

 

3. 布尔

添加布尔修改器,指定参照物体。

布尔插件:Bool Tool。添加插件后,在工具栏->工具下有Bool Tool,选中两个物体可以进行布尔操作。

 

4. 修改器顺序

从上到下执行

 

5. 表皮修改器制作青蛙

创建平面,选中四点,ALT+M合并到中心,添加镜射修改器,挤出顶点,添加表皮修改器,添加表面细分修改器。

表皮修改器标记根结点。
对顶点不能直接使用S键缩放,缩放顶点周边使用CTRL+A。

做出大概形状后应用表皮修改器,再进一步进行细化。
需要先应用镜射修改器再应用表皮修改器。
表皮修改器可以直接创建简单的骨架。

 

 

if not mat.use_nodes or not mat.node_tree: ... continue ... >>> # 跳过只读材质[^2] >>> if mat.library or mat.users == 0: File "<blender_console>", line 1 if mat.library or mat.users == 0: IndentationError: unexpected indent >>> continue File "<blender_console>", line 1 continue IndentationError: unexpected indent >>> >>> nodes = mat.node_tree.nodes File "<blender_console>", line 1 nodes = mat.node_tree.nodes IndentationError: unexpected indent >>> links = mat.node_tree.links File "<blender_console>", line 1 links = mat.node_tree.links IndentationError: unexpected indent >>> >>> # 查找原理化BSDF节点 >>> bsdf_node = None File "<blender_console>", line 1 bsdf_node = None IndentationError: unexpected indent >>> for node in nodes: File "<blender_console>", line 1 for node in nodes: IndentationError: unexpected indent >>> if node.type in {'BSDF_PRINCIPLED', 'PRINCIPLED_BSDF'}: File "<blender_console>", line 1 if node.type in {'BSDF_PRINCIPLED', 'PRINCIPLED_BSDF'}: IndentationError: unexpected indent >>> bsdf_node = node File "<blender_console>", line 1 bsdf_node = node IndentationError: unexpected indent >>> break File "<blender_console>", line 1 break IndentationError: unexpected indent >>> >>> if not bsdf_node: File "<blender_console>", line 1 if not bsdf_node: IndentationError: unexpected indent >>> continue File "<blender_console>", line 1 continue IndentationError: unexpected indent>>> >>> # 处理法线输入 >>> normal_input = bsdf_node.inputs.get('Normal') File "<blender_console>", line 1 normal_input = bsdf_node.inputs.get('Normal') IndentationError: unexpected indent >>> if normal_input: File "<blender_console>", line 1 if normal_input: IndentationError: unexpected indent >>> # 1. 断开所有连接 >>> for link in list(normal_input.links): File "<blender_console>", line 1 for link in list(normal_input.links): IndentationError: unexpected indent >>> links.remove(link) File "<blender_console>", line 1 links.remove(link) IndentationError: unexpected indent >>> >>> # 2. 重置为默认值 >>> normal_input.default_value = (0.0, 0.0, 1.0) # 世界空间法线方向 File "<blender_console>", line 1 normal_input.default_value = (0.0, 0.0, 1.0) # 世界空间法线方向 IndentationError: unexpected indent >>> >>> # 3. 可选:添加法线贴图节点并设置默认值 >>> normal_map = nodes.new(type='ShaderNodeNormalMap') File "<blender_console>", line 1 normal_map = nodes.new(type='ShaderNodeNormalMap') IndentationError: unexpected indent >>> normal_map.location = (bsdf_node.location.x - 300, bsdf_node.location.y) File "<blender_console>", line 1 normal_map.location = (bsdf_node.location.x - 300, bsdf_node.location.y) IndentationError: unexpected indent >>> normal_map.inputs['Strength'].default_value = 1.0 # 默认强度 File "<blender_console>", line 1 normal_map.inputs['Strength'].default_value = 1.0 # 默认强度 IndentationError: unexpected indent >>> >>> # 连接法线贴图节点 >>> links.new(normal_map.outputs['Normal'], normal_input) File "<blender_console>", line 1 links.new(normal_map.outputs['Normal'], normal_input) IndentationError: unexpected indent >>> >>> # 执行函数 >>> reset_all_normal_connections() >>>
08-16
# 执行修复 >>> reset_normal_inputs() >>> import bpy >>> >>> def reset_normal_inputs(): ... processed_count = 0 ... for mat in bpy.data.materials: ... # 增强材质过滤 ... if not mat.use_nodes: continue ... if getattr(mat, 'library', None): continue ... if mat.users == 0: continue ... >>> nodes = mat.node_tree.nodes File "<blender_console>", line 1 nodes = mat.node_tree.nodes IndentationError: unexpected indent >>> links = mat.node_tree.links File "<blender_console>", line 1 links = mat.node_tree.links IndentationError: unexpected indent >>> >>> # 查找所有BSDF节点 >>> bsdf_nodes = [n for n in nodes if n.bl_idname in { File "<blender_console>", line 1 bsdf_nodes = [n for n in nodes if n.bl_idname in { IndentationError: unexpected indent >>> 'ShaderNodeBsdfPrincipled', File "<blender_console>", line 1 'ShaderNodeBsdfPrincipled', IndentationError: unexpected indent >>> 'BSDF_PRINCIPLED', File "<blender_console>", line 1 'BSDF_PRINCIPLED', IndentationError: unexpected indent >>> 'PRINCIPLED_BSDF' File "<blender_console>", line 1 'PRINCIPLED_BSDF' IndentationError: unexpected indent >>> }] File "<blender_console>", line 1 }] IndentationError: unexpected indent >>> >>> for bsdf in bsdf_nodes: File "<blender_console>", line 1 for bsdf in bsdf_nodes: IndentationError: unexpected indent >>> normal_input = bsdf.inputs.get('Normal') File "<blender_console>", line 1 normal_input = bsdf.inputs.get('Normal') IndentationError: unexpected indent >>> if not normal_input: continue File "<blender_console>", line 1 if not normal_input: continue IndentationError: unexpected indent >>> >>> # 递归清除法线节点树 >>> clear_normal_tree(links, normal_input) File "<blender_console>", line 1 clear_normal_tree(links, normal_input) IndentationError: unexpected indent >>> >>> # 重置默认值 (0,0,1) 世界法线 >>> normal_input.default_value = (0.0, 0.0, 1.0) File "<blender_console>", line 1 normal_input.default_value = (0.0, 0.0, 1.0) IndentationError: unexpected indent >>> processed_count += 1 File "<blender_console>", line 1 processed_count += 1 IndentationError: unexpected indent >>> >>> print(f"成功重置 {processed_count} 个材质的法线输入") File "<blender_console>", line 1 print(f"成功重置 {processed_count} 个材质的法线输入") IndentationError: unexpected indent >>> >>> def clear_normal_tree(links, input_socket): ... """递归删除法线输入连接的节点树""" ... while input_socket.links: ... link = input_socket.links[0] ... upstream_node = link.from_node ... links.remove(link) ... >>> # 递归清除上游节点 >>> for inp in upstream_node.inputs: File "<blender_console>", line 1 for inp in upstream_node.inputs: IndentationError: unexpected indent >>> clear_normal_tree(links, inp) File "<blender_console>", line 1 clear_normal_tree(links, inp) IndentationError: unexpected indent >>> >>> # 删除节点(避免孤立节点) >>> if not any(oup.links for oup in upstream_node.outputs): File "<blender_console>", line 1 if not any(oup.links for oup in upstream_node.outputs): IndentationError: unexpected indent >>> upstream_node.free() File "<blender_console>", line 1 upstream_node.free() IndentationError: unexpected inde还是失败了
最新发布
08-16
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值