3D designer

mCleaner

2012/03/15
version 1.2

Check and Clean Objects and Scenes

Softimage 2010 and above (it will probably work at some level in previous versions).

Version History

2012/03/15 v1.2
Japanese support added (GUI only). Overlapping Component selection added.
Added Progress Bar to Find Doule Edges and some other minor changes.
GUI slightly modified.
2012/03/13 v 1.1
Bounding Box bug fixed. Added log reports to Find Ngons and Find Double Edges
2012/03/12 v 1.0
Added new tools : Find Valence Two, Delete Empty Folders, etc.
2012/03/05 v 0.2
mCleaner First beta Version (not released). Scn Cleaner implemented.
2011/12/19 v 0.1
mObject Cleaner beta


インストール方法

以前のバージョンは既にインストールしている場合、アンインストールして下さい。
このアドオンはプリファレンスを使うので、プリファレンスファイルも削除する必要があるので、 このアンインストールツールを使うと便利です。スクリプトエディターで実行すれば自動にmCleanerをアンインストールします。

xsiaddonを画面にドラッグ&ドロップ。

起動する方法

インストールした後に、Editメニューから mCleanerボタンにクリックするだけです。

オブジェクトを選んで好きな設定で実行。
マルチ選択とブランチ選択も対応しています。

実行した後に、CTRL を押しながらEditメニューに 中クリックするとObjCleanerが実行されます。

言語

v1.2からGUIだけは日本語対応になります。 これはSoftimageが日本語になっている場合に自動にmCleanerのGUIも日本語になります。

Softimageの言語設定を無視して、mCleanerを日本語にしたい場合テキストエディターでmCleaner.jsプラグインを開いて、// var lang = "jp" の // を消せば日本語になります。

機能の説明

このツールは2モードの実行方法があります。

Check Only
設定されたオプションの確認のみになります。
その結果はスクリプトエディタにログを残します。

Run Cleaner
整理モードです。

Object Cleaner

これは分かりやすいと思います。クラスタ削除ツール。
この機能は潤樹さんの秒殺クラスタを参考にしました。
3列目はクラスタじゃなくて、クラスタプロパティです。その場合はプロパティだけが削除されます

マテリアル共有しているクラスタマージ
マテリアルを共有しているクラスターをマージする機能です。

空クラスタ削除
プロパティがないサンプルクラスターやサブコンポーネントがないポイントクラスタなど、空クラスタを削除します。

ポリゴンクラスタをマテリアル名にリネーム
ポリゴンクラスタをマテリアル名にリネームします。これもまた潤樹さんのスクリプトをパクっています。

テクスチャプロジェクションエンベロープのリネーム機能です。

UVをイメージクリップに最アサイン
ここは、リネームしたテクスチャプロジェクションをマテリアルにアサインする機能です。
特徴なシェーダーには効かないかもしれません。
これは複数のUVは非対応になります。

プロパティ削除
CrosswalkやUnfoldによる不要なプロパティを削除する。

SRTフリーズ
普通にTransformメニューでフリーズすると変わらないけど、チェックモードにするとフリーズされていないオブジェクトを報告こうしてくれます。

ジオメトリアプロクシメーション
ローカル = ジオメトリアプロクシメーションをローカルにする。またはチェック
共有 = オブジェクトのジオメトリアプロクシメーションを共有に変更する。またはチェック


ポリゴン数
選択されたオブジェクトのポリゴン数を確認します。

三角形数 = 三角形の数をログします
四角形数= 四角形の数をログします
多角形数= 多角形の数をログします

設定
全On 全 Off
設定カスタマイズ を楽にするためのオプションです。そのままは使うことはないでしょう。

デフォルト
デフォルト設定。(俺好みの設定)

カスタム
プリセットの読み込みです。
プラグインに入っているPropファイルを読み込みます。
自分だけのカスタムプロパティを上書きすることも可能です。

 

Scene Cleaner


全パスを削除

マテリアルライブラリを統合
DefaultLibというマテリアルライブラリに全マテリアルをまとめます

未使用マテリアル削除
XSIの未使用マテリアル削除機能

マテリアル名をイメージクリップ名にリネームマテリアル名はイメージクリップのテクスチャファイルと同じ名前にする。
特徴なマテリアルや複数のテクスチャがあるマテリアルには効果が変わったりすることもあります。


未使用イメージクリップ削除
Softimageの未使用イメージクリップ削除機能

イメージクリップリネーム
イメージクリップ名をテクスチャファイル名と同じにします。
複数のイメージクリップが同じテクスチャファイルを使う場合、イメージクリップ名に数字が付いてしまいまs。

全レイヤー削除

空レイヤー削除

空グループ削除
シーンルートにある空グループを削除
現バージョンではシーンルートのグループしか確認できません。
次のバージョンでシーンの中の全てのグループを確認するように変更する予定です。

プロパティがないグループ削除
プロパティ(マテリアル、ビジビリティ、等、なんの効果もない)を持っていないグループを探して削除。
次のバージョンでシーンの中の全てのグループを確認するように変更する予定です。


シーンルートのカスタムプロパティ削除
シーンルートにあるプロパティーを全部削除

リファレンスプレーン削除
全リファレンスプレーン削除

プロジェクト管理
注意:ゴミ箱を使わずにファイルとフォルダを削除するので、アンドゥが出来ません。

未使用テクスチャファイル削除
Picturesフォルダ内の未使用テクスチャファイルを削除します。
この機能はBernard LebelさんのCleanuppicturesを参考にしました。

空フォルダ削除
はプロジェクト内の空フォルダ削除。mXSIFolderCleanerを基にした機能です。

サムネル削除はプロジェクト内のサムネールファイル・フォルダ削除。mXSIFolderCleanerを基にした機能です。

 

Other Tools

その他。汚いポリゴンを少しでも綺麗にするために役に立ちそうなツールです。


全ポリゴンメッシュを選択
シーンの中のポリゴンメッシュオブジェクトを全部選択する

多角形を選択
選択されたオブジェクトの中の多角形以上のポリゴンを選択する。
Selectメニューの5角形以上の選択ツールと同じ。

三角形化・四角形化
選択されているポリゴンを三角形化してから四角形化する。

ヴぁれんす2ポイント
選択されたオブジェクトの中のValence 2 ポイント(エッジ2本しかないポイント)を選択する。

ダブルエッジ
選択されたオブジェクトに2ポリ以上を共有しているエッジを探す。

重なっているコンポーネントを探す
重なっているコンポーネントを探して、選択する機能。
「コンポーネントを両方選択」というオプションを外すと、重なっているコンポーネントを一つを残して選択されません。

ポイント (Complete)
全ポイントの位置を比較して重なっているポイントを探す機能なので、とても重たくて遅いです。1200ポイント以上があると、警告メッセージが出てきます。
ポイント選択も対応しているので、ハイポリの場合はポイント選択して、少しずつチェックするのはおすすめです。

ポイント (Quick)
このオプションはポイントのすぐ隣のポイントだけをチェックするから計算が速いです。普段は繋がっていないポイントが重なったりはしないので、この機能の方がおすすめです。

ポリゴン
ポイントと同じように、重なっているポリゴンを探して選択する機能です。これも全ポリゴンの位置を比較しているのでとても遅いです。1200ポリ以上の時に、警告メッセージが出てきます。
ポリゴン選択も対応しているので、ハイポリの場合はポイント選択して、少しずつチェックするのはおすすめです。




 

mCleaner

How to Install

If you had already installed a previous version of mCleaner you will have to uninstall it first. Since mCleaner uses a preference file you may have to delete it. I created an uninstaller to make the uninstalling process easier: Download Uninstall Tool Run it from your Script Editor.

Once you have uninstalled it, Drag & Drop the xsiaddon file in a viewport.

If this is your first mCleaner installation, then just Drag & Drop it into a viewer. You can drag it directly from the download link.

You will find a new button named "mCleaner" in your Edit Menu in the down-right side of your screen.

After run it at least once, if you middle click the Edit Menu while pressing Ctrl, it will run the ObjCleaner with the last settings. This "shortcut" only works with ObjCleaner.

What it does

The Plugin has 2 modes, Run Mode and Check Mode.

Check Mode will only check if the object or scene matches the mCleaner options and log a report. It won't change anything in your Scene.

Run Mode will fix those options that doesn't match your mCleaner settings.

Language

If you want to personalize the GUI language, you can open the mCleaner.js with a text editor and edit the function layN() . If you do it, please, contact me to try to include it in my next version ( If I ever release one :D ).

ObjCleaner

Select one object and RUN. It supports branch selections too, so you could branch select the SceneRoot per example.

Delete Clusters

The idea and part of the code is based on Junki's Cluster byosats tool. It deletes the selected cluster types (or check their existence).
The third column are Cluster Properties. Since most of Sample properties use the same cluster, this option will only delete the property.

Merge Clusters w/same Materials
Merge Polygon Cluster that are sharing Material. It will try to get the local material first to prevent group and passes material effects.
This is based on toussa and Junki's code.

Delete Empty Clusters
It will delete all those clusters without components and / or properties. (It will delete sample clusters without properties)

Rename Poly Clusters to Material Name
Rename all Polygon Clusters to their Material's Name with the option to add a Prefix and / or Sufix


Texture Projection Renamer

Reassign UV to Image Clips
This option will reassign the renamed UV in the Image Clip of the Object's Materials.
It may not work with non default SI Materials. (untested)

Delete Properties
Deletes properties that are usually created by Crosswalk and Unfold.

Freeze SRT
This is the same Freeze function than the original in the Transform Menu.

Geometry Approximation
Local = Converts the Geometry Approximation to Local
Shared = Converts the Geometry Approximation to Global

This options are only for Check. They don't change anything
PolyCount
Logs if the object has more triangles than the specified.
Report Tris , Report Quads , Report Ngons
Report Tris, Quads and Ngons if found.

Settings
All On, All Off
These are options to help you customize your settings.

Default
Default settings

Custom
This option load a preset file you can find in the addon folder.
You can save your own preset file and overwrite this one to make your own settings button.


Scn Cleaner

Delete All Passes

Merge All Material Libs
Merge all Material Libraries into one named DefaultLib

Del.Unused Material
Run the option you can find in external files in your File Menu.

Rename Materials to Texture Name
It will try to rename Materials to their Texture file name.
You may have unexpected results with multi textured materials, or Materials sharing textures.

Del.Unused Img.Clips
Run the option you can find in external files in your File Menu.

Rename Image Clips
It will try to rename all Image Clips to their texture names.
If you are using multiple Image Clips with the same texture, it will try to rename it with the same name and therefore add a number as sufix.

Delete All Layers and Delete Empty Layers is self explained.

Delete Empty Groups
It will delete Empty groups without members.
It only detects groups in the Scene Root. I will change this in the next version.

Delete Groups without properties
It will delete Groups without any effect in their members.
It only detects groups in the Scene Root. I will change this in the next version.

Delete All Scene Properties
Delete All Custom Properties that are in the Scene Root.

Delete All Reference Planes

Project File Management
Warning : This option will delete files in your Project Folder without using the Recycle Bin. You may not be able to undo this (unless you use some special tool like recuva)

Delete Unused Image Files from Disk
Delete all unused image files in the Folder Pictures in your Project Folder. It won't check any other folder, nor folders inside Pictures.
This option is based in Bernard Lebel Cleanuppictures.

Delete Empty Folders from Project Folder
Based on my own tool mXSIFolderCleaner. It deletes all empty folders and subfolders inside your Project.

Delete Thumnails from Project Folder
Based on my own tool mXSIFolderCleaner. Deletes All XSI and Windows Thumbnails.

 

Other Tools

These are other tools that may help you in one way or another to clean your objects

Select All Polymesh Obj
Select All Polymesh Objects in your Scene.

Find Ngons
Find All polygons with 5 sides or more. It does the same as the Select n-sided polygons in the Selection Menu.

Tri/Quadrangulate Ngons
It just Applies Triangulate and Quadrangulate in the selected polygons.

Find Int.points w/Valence 2
Find points with Valence 2 (with only 2 edges).

Find Double Edges
Find and Selects all those Edges that shares 2 polygons or more. This option can be a little slow in high poly meshes, and very slow in triangled high poly meshes.

Overlapping Components
Search for componets that are in the same place.
if you uncheck [Select both components] it will leave one component unselected.
This option doesn't check if the selected componets are correlatives so you may have unspected results. It is safe to use it to check your objects, but I don't recommend to take any automatic action like delete the selected polygons.

Points (Complete)
This option will check all points in the object and search for those that are overlapping. It compare every point in the mesh so it is very slow in high polygon meshes. Just in case you'll get a warning if you have more than 1200 points in your object.
Alternatively, you can use point selections and run the tool. It will be much faster since it will check and compare only the selected points.

Points (Quick)
This option will only check every point with their neighboard points, and therefore it is much faster than the previous method. I recommend to use this option because is very uncommon to have overlapping points that are not adjacents.

Polygons
This option, uses the same logic than the Points(Complete). It check and compares all polygons, and therefore it is extremely slow with high poly meshes. You'll get warned if you try to do it with more than 1200 polygons.This option also allows you to check selected polygons.


inserted by FC2 system