■ インストール
Mayaの scripts フォルダにコピー
■ 実行方法
import checkMalware; checkMalware.main()
入力ウィンドウが出てきて、ここに確認したいフォルダを入力して、OKにクリック。
感染したファイルのリストが出てきて、シーン名にダブルクリックで開けます。
※ incrementalsaveの中はチェックしない
# myara -------------------------------------------------------------------------------
if cmds.file(q=True, sn=True) == "":
cmds.warning("No Name Found. Renaming")
realName = cmds.file(query=True, l=True)[0]
cmds.file(rename=realName)
# ------------------------------------------------------------------------------- myara
image = pyTGA.Image()
image.load( texture_filePath )
print image._header.pixel_depht
from struct import unpack
def dec_byte(data, size=1, littleEndian=True):
"""Decode some data from bytes.
Args:
data (bytes): data to decode
size (int): number of bites of the data
littleEndian (bool): little endian or big endian
Returns:
int: the decoded data
"""
order = str('<' if littleEndian else '>')
format_ = str((None, 'B', 'H', None, 'I')[size])
return unpack(order + format_, data)[0]
class TGAHeader(object):
"""
#- Field(1)
# ID LENGTH (1 byte):
# Number of bites of field 6, max 255.
# Is 0 if no image id is present.
#
#- Field(2)
# COLOR MAP TYPE (1 byte):
# - 0 : no color map included with the image
# - 1 : color map included with the image
#
#- Field(3)
# IMAGE TYPE (1 byte):
# - 0 : no data included
# - 1 : uncompressed color map image
# - 2 : uncompressed true color image
# - 3 : uncompressed black and white image
# - 9 : run-length encoded color map image
# - 10 : run-length encoded true color image
# - 11 : run-length encoded black and white image
#
#- Field(4)
# COLOR MAP SPECIFICATION (5 bytes):
# - first_entry_index (2 bytes) : index of first color map entry
# - color_map_length (2 bytes)
# - color_map_entry_size (1 byte)
#
#- Field(5)
# IMAGE SPECIFICATION (10 bytes):
# - x_origin (2 bytes)
# - y_origin (2 bytes)
# - image_width (2 bytes)
# - image_height (2 bytes)
# - pixel_depth (1 byte):
# - 8 bit : grayscale
# - 16 bit : RGB (5-5-5-1) bit per color
# Last one is alpha (visible or not)
# - 24 bit : RGB (8-8-8) bit per color
# - 32 bit : RGBA (8-8-8-8) bit per color
# - image_descriptor (1 byte):
# - bit 3-0 : number of attribute bit per pixel
# - bit 5-4 : order in which pixel data is transferred
# from the file to the screen
"""
def __init__(self, file_name):
with open(file_name, "rb") as image_file:
# Read Header
image_file.seek(0)
# ID LENGTH
self.id_length = dec_byte(image_file.read(1))
# COLOR MAP TYPE
self.color_map_type = dec_byte(image_file.read(1))
# IMAGE TYPE
self.image_type = dec_byte(image_file.read(1))
# COLOR MAP SPECIFICATION
self.first_entry_index = dec_byte(image_file.read(2), 2)
self.color_map_length = dec_byte(image_file.read(2), 2)
self.color_map_entry_size = dec_byte(image_file.read(1))
# IMAGE SPECIFICATION
self.x_origin = dec_byte(image_file.read(2), 2)
self.y_origin = dec_byte(image_file.read(2), 2)
self.image_width = dec_byte(image_file.read(2), 2)
self.image_height = dec_byte(image_file.read(2), 2)
self.pixel_depth = dec_byte(image_file.read(1))
self.image_descriptor = dec_byte(image_file.read(1))
tga = TGAHeader( texture_filePath )
print tga.image_type #3以下の場合は圧縮なし
print tga.image_height #高さ
print tga.image_width #横幅
print tga.pixel_depth #24bit か 32bit
Maya Transfer Attributes without history from myara on Vimeo.
Author:myara
ペルー生まれ育ちのCGデザイナー
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | - | - | - | - | 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 | - | - | - | - | - | - |
Want to be friends with this user.