loadModel() options break without fileType and ignore flipU/flipV
维护者通常 3 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript
调研方向
loadModel(path, options) 的选项解析位于 src/webgl/loading.js 第 573-581 行附近;issue 指出 fileType 在读取 flipU 和 flipV 之前被重新赋值,因此 options 对象可能会走到 .toLowerCase()。请先阅读该代码块,然后分别使用 loadModel('model.obj', { flipU: true }) 以及包含 fileType 的调用形式复现问题。当两种调用形式都能无错误加载,并且翻转选项已应用到加载的模型上时,即完成。
由索引模型根据 Issue 内容生成。
描述
Most appropriate sub-area of p5.js?
- Accessibility
- Color
- Core/Environment/Rendering
- Data
- DOM
- Events
- Image
- IO
- Math
- Typography
- Utilities
- WebGL
- WebGPU
- p5.strands
- Build process
- Unit testing
- Internationalization
- Friendly errors
- Other (specify if possible)
p5.js version
2.3.2 / current main
Web browser and version
Chromium 151
Operating system
Fedora Linux
Steps to reproduce this
The documented loadModel(path, options) overload breaks depending on whether fileType is included.
async function setup() {
createCanvas(100, 100, WEBGL);
// Throws: fileType.toLowerCase is not a function
await loadModel('model.obj', { flipU: true });
// Loads, but flipU is ignored
await loadModel('model.obj', {
fileType: '.obj',
flipU: true
});
}
Options like { normalize: true } or {} also throw when fileType is omitted. With fileType present, flipU / flipV are ignored, although calling model.flipU() / model.flipV() afterwards works.
Expected: loadModel(path, options) should work without requiring fileType, and the flip options should be applied.
I traced it to the options parsing here:
fileType is reassigned before flipU / flipV are read, so without fileType the options object eventually reaches .toLowerCase(), while with it the flags are read from a string.
- 主要语言
- JavaScript
- 星标
- 24.1k
- 派生
- 3.9k
- 平均合并
- 2 天 22 小时
- 30 天内合并 PR
- 38
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
processing/p5.js 的其他 Issue
-
[p5.js 2.0+ Bug Report]: key docs needs updating可能已有人在做 @MannXo 今天认领。 未关闭Help Wanted
难度 1/5 1 小时以内 新手友好度 62/100
processing/p5.js#9296 · 5 条评论 · 1 个 reaction ·
维护者通常 3 天内回复
-
False positive FES warning for loadModel(path, callback)可能已有人在做 @xsupremeyx 于 1 天前认领。 未关闭p5.js 2.0+
难度 2/5 1-3 小时 新手友好度 62/100
processing/p5.js#9295 · 1 条评论 · 已指派 1 人 ·
维护者通常 3 天内回复
-
Add unit tests for noiseDetail()可能已有人在做 @harshiltewari2004 于 3 天前认领。 未关闭Area:Math Enhancement
难度 2/5 1-3 小时 新手友好度 75/100
processing/p5.js#9253 · 2 条评论 · 已指派 1 人 ·
维护者通常 3 天内回复
-
[p5.js 2.0+ Bug Report]: storeItem() validation branches are missing `return`, so bad input throws a TypeError or is stored anyway可能已有人在做 @iUjjwalRaj 于 11 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 85/100
processing/p5.js#9242 ·
维护者通常 3 天内回复
-
[p5.js 2.0+ Bug Report]: getURLParams() mis-parses valueless parameters and never percent-decodes values可能已有人在做 @mayanksingh-7974 于 5 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 88/100
processing/p5.js#9241 · 1 条评论 ·
维护者通常 3 天内回复
相似的 Issue
-
BUG
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
type/bug
难度 1/5 1 小时以内 新手友好度 75/100
flarum/framework#5231 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
apache/rocketmq-dashboard#6896 ·
维护者通常 3 天内回复
-
bug good first issue
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
[workshop-sync] workshop/side-quest-17-06-output-injection.md: stale add_comment.cjs line references未关闭documentation
难度 2/5 1-3 小时 新手友好度 78/100
githubnext/gh-aw-workshop#4679 ·
维护者通常 1 天内回复