[Closed] Resource Collector – Scripted plugin
This is my code:
plugin SimpleObject TestObject
name:"TestObject"
classID:#(0x77cd08f0, 0x2088eed)
category:"Test"
(
parameters main_Param
(
maps type:#filenametab tabSizeVariable:true assettype:#Bitmap
)
tool create
(
on mousePoint click do
(
nodeTM.translation = gridPoint
#stop
)
)
)
resetmaxfile #noprompt
TestObject isselected:true maps:(getfiles @"E:\Mehdi\Temp\New folder\*.jpg")
the code will add some image path to filenameTab parameter, This maps may be used in the scene, maybe not. but Resource Collector will not collect them. How we can force Asset Manager and Resource collector to recognize them as regular maps? So when I open Asset Tracking (shift+T) they be shown in the list?
something like this might be a starting point…
plugin SimpleObject TestObject
name:"TestObject"
classID:#(0x77cd08f0, 0x2088eed)
category:"Test"
(
parameters main_Param
(
maps type:#filenametab tabSizeVariable:true assettype:#Bitmap
)
tool create
(
on mousePoint click do
(
nodeTM.translation = gridPoint
#stop
)
)
on attachedToNode this_node do
(
mat = multimaterial numsubs:maps.count;
for m = 1 to maps.count do mat[m].diffusemap = bitmaptexture filename:maps[m];
this_node.mat = mat;
)
)
works if you use scripted creation seems to… in both asset manager (if you press the refresh button) and it collected a load of images in the archive when using the resource collector … if
you use
on attachedToNode this_node do
(
mat = multimaterial numsubs:maps.count;
for m = 1 to maps.count do mat[m].diffusemap = bitmaptexture filename:maps[m];
this_node.mat = mat;
)
it will work from the create panel (though will need code for adding images)
my bad, Yes, it’s work. But is this the only way? If we delete the object, maps will be deleted automatically. I need a permanent method.
What you want is most likely impossible to do. If you check the Resource Collector source files in sdk you’ll see that in order to collect bitmap filenames it iterates over scene nodes and checks applied materials. No nodes means no materials and thus no filenames as I understand it.
you could attach the data to rootnode (as appdata) and edit resource collector code to handle it, don’t know much about the asset browser though so not sure of your options there. perhaps something in ATSOps does it for you.