npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

obj-toolkit

v2.0.4

Published

obj toolkit

Readme

obj-toolkit

使用 fbx2gltfobj2gltfgltf-pipeline 处理模型。

v1 doc

Install

npm install -g obj-toolkit

配置信息 config

  • 支持 fbx 转化为 glbgltf
  • 支持 obj 转化为 glbgltf
  • 支持 glbgltf 相互转化
  • 支持 gltf 的压缩

使用

支持的参数

注意,如果别名多于 2 个字符时,需要使用 --alias 来进行使用

执行方式:

  • --obj-gltf obj -> gltf
  • --obj-glb obj -> glb
  • --gltf-glb gltf -> glb
  • --glb-gltf glb -> gltf
  • --fbx-glb fbx -> glb
  • --fbx-gltf fbx -> gltf

输出额外配置项:

  • -i 目标文件或目录,默认当前文件夹
  • -o 输出文件或目录,默认当前文件夹
  • -m 压缩模型
  • -s bin 文件独立 gltf optimizeGltf 起效
  • -t 材质独立 gltf optimizeGltf 起效
  • -d debug 模式 输出相关参数

不设置执行参数时,默认使用 toGltf

命令行

# 查看版本
objkit -v
# obj
# 当前目录下的所有 obj
objkit --obj-gltf # obj -> gltf
objkit --obj-glb # obj -> glb
# 指定 obj 文件
objkit --obj-gltf -i path/ttt.obj -o path/ttt.gltf

# gltf
objkit --gltf-glb # gltf -> glb
objkit --glb-gltf # glb -> gltf

# gltf minify
objkit --glb-gltf -m # 压缩 gltf
objkit --glb-gltf -t # 提取材质
objkit --glb-gltf -s # 提取独立的bin文件

objkit --fbx-glb # fbx -> glb
objkit --fbx-gltf # fbx -> gltf
objkit --fbx-glb -m # fbx -> glb, 压缩 glb
# fbx -> gltf 压缩模式,建议采用如下方式(由于fbx方式会自动创建独立的 buffer.bin 文件):

# 1. fbx -> glb
objkit --fbx-glb
# 2. glb -> gltf, 再压缩
objkit --glb-gltf -m

注意事项,如果将 obj 转化为 gltf,不支持直接压缩,需要转化为 gltf 之后,再执行压缩 在 gltf 文件根目录直接执行 objkit --glb-gltf -m -o minout 即可,如果有图片资源,会出现异常,不用处理,执行完毕之后,需要自行拷贝图片 或者 直接执行 objkit -m -o minout 与上述的结果一致。

author

ilex.h

changelog

  • 2022-07-22 v2.0.2 add obg2gltf 分离材质时,设置默认材质路径
  • 2021-04-29 v2.0.1 add file list json mapping
  • 2021-03-31 v2.0.0 modify cli
  • 2019-10-23 v1.0.0 init

Lecense

MIT