Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@texture-transform/cli

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@texture-transform/cli - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

18

dist/cli.esm.js
import caporal from '@caporal/core';
import { resolveTextureLocation, remapTextureLocation, checkFilesDoNotExist, readTexture, specGlossToMetalRough, writeTexture } from '@texture-transform/core';
import { resolveTextureLocation, remapTextureLocation, checkFilesDoNotExist, readTexture, extractTextureChannel, specGlossToMetalRough, writeTexture } from '@texture-transform/core';
import fsPromises from 'fs/promises';
var name = "@texture-transform/cli";
var version = "1.0.4";
var version = "1.0.5";
var type = "module";

@@ -43,3 +44,3 @@ var description = "A set of tools for converting between different 3D shader material textures";

"@caporal/core": "^2.0.2",
"@texture-transform/core": "1.0.3",
"@texture-transform/core": "1.0.5",
"@types/node": "^18.16.1"

@@ -110,2 +111,10 @@ };

logger.info(`Saving textures`);
try {
await fsPromises.access(outputDirectory);
} catch {
logger.info(`Creating output directory as it didn't exists.`);
await fsPromises.mkdir(outputDirectory, {
recursive: true
});
}
if (!opts.overwrite) {

@@ -122,2 +131,3 @@ // check if files exist

const [diffuseTexture, specularTexture, glossinessTexture] = await Promise.all([readTexture(diffuseLocation.path), readTexture(specularLocation.path), readTexture(glossinessLocation.path)]);
const singleChannelGlossinessTexture = glossinessTexture.channels === 1 ? glossinessTexture : extractTextureChannel(glossinessTexture, 0);
logger.info(`Converting textures`);

@@ -128,3 +138,3 @@ const {

roughnessTexture
} = specGlossToMetalRough(diffuseTexture, specularTexture, glossinessTexture);
} = specGlossToMetalRough(diffuseTexture, specularTexture, singleChannelGlossinessTexture);
await Promise.all([writeTexture(baseTexture, baseLocation.path, quality), writeTexture(metallicTexture, metallicLocation.path, quality), writeTexture(roughnessTexture, roughnessLocation.path, quality)]);

@@ -131,0 +141,0 @@ });

{
"name": "@texture-transform/cli",
"version": "1.0.4",
"version": "1.0.5",
"type": "module",

@@ -41,5 +41,5 @@ "description": "A set of tools for converting between different 3D shader material textures",

"@caporal/core": "^2.0.2",
"@texture-transform/core": "1.0.3",
"@texture-transform/core": "1.0.5",
"@types/node": "^18.16.1"
}
}
import caporal from '@caporal/core';
import {
checkFilesDoNotExist,
extractTextureChannel,
readTexture,

@@ -12,2 +13,3 @@ remapTextureLocation,

} from '@texture-transform/core';
import fsPromises from 'fs/promises';

@@ -112,2 +114,9 @@ import rawPackageJson from '../package.json';

try {
await fsPromises.access(outputDirectory);
} catch {
logger.info(`Creating output directory as it didn't exists.`);
await fsPromises.mkdir(outputDirectory, { recursive: true });
}
if (!opts.overwrite) {

@@ -135,5 +144,14 @@ // check if files exist

const singleChannelGlossinessTexture =
glossinessTexture.channels === 1
? glossinessTexture
: extractTextureChannel(glossinessTexture, 0);
logger.info(`Converting textures`);
const { baseTexture, metallicTexture, roughnessTexture } =
specGlossToMetalRough(diffuseTexture, specularTexture, glossinessTexture);
specGlossToMetalRough(
diffuseTexture,
specularTexture,
singleChannelGlossinessTexture
);

@@ -140,0 +158,0 @@ await Promise.all([

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc