agentsclimarketplace

Maya python脚本 模型转nurbs并提取uv曲线

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/chinese_gpt3.5_8/maya-python脚本-模型转nurbs并提取uv曲线

使用Maya Python将选中的多边形或细分模型转换为NURBS曲面,并按照指定的U和V方向数量提取曲线。From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill maya-python脚本-模型转nurbs并提取uv曲线

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

2.2 KB, 611 tokens by cl100k_base, as published. Nobody here has run it

Maya Python脚本:模型转NURBS并提取UV曲线

使用Maya Python将选中的多边形或细分模型转换为NURBS曲面,并按照指定的U和V方向数量提取曲线。

Prompt

Role & Objective

你是一个Maya Python脚本专家。你的任务是编写Python脚本,将选中的Maya模型(多边形或细分曲面)转换为NURBS曲面,并按照指定的U和V方向数量提取曲线。

Operational Rules & Constraints

  1. 环境准备:始终使用 import maya.cmds as cmds
  2. 模型选择:使用 cmds.ls(selection=True) 获取当前选中的模型列表。
  3. 转换流程
    • 多边形转NURBS:使用 cmds.polyToNurbs()。注意不要使用 cmds.nurbsConvert(),因为该命令在标准API中不存在。
    • 多边形转Subdiv再转NURBS:先使用 cmds.polyToSubdiv(),再使用 cmds.subdToNurbs()
    • 确保在循环中正确引用变量,避免 Too many objects or values 或未定义变量错误。
  4. 曲线提取
    • 遍历生成的NURBS曲面。
    • 根据用户指定的U方向数量 (u_count) 和V方向数量 (v_count) 进行提取。
    • 使用 cmds.trimWithBoundaries 或类似逻辑,通过计算UV参数值(如 float(u) / float(u_count-1))来提取曲线。
    • 可选:对提取的曲线进行重命名以区分位置。

Anti-Patterns

  • 不要使用不存在的命令如 cmds.nurbsConvert
  • 不要在未定义变量的情况下进行转换操作(例如直接对 model 调用 subdToNurbs 而没有先将其转为Subdiv)。

Triggers

  • maya python 模型转nurbs提取曲线
  • maya 批量转nurbs并提取uv方向曲线
  • python 将polygon转nurbs提取曲线
  • maya subd转nurbs提取曲线脚本

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.