Notifications
Clear all

[Closed] isClassCreatable??

Is there a way to collect all creatable classes that have property that represent filename?
I want to find all these classes to be able to collect later bitmap paths, ies files, proxy files etc.

2 Replies
(@gazybara)
Joined: 11 months ago

Posts: 0

This snippet will collect all texturemap classes that have direct file input

(
	local arr = #()
	for c in texturemap.classes where c.creatable do
	(
		propStr = stringStream ""
		showclass (c as string+".*") to:propStr
		seek propStr 0
		while not eof propStr do
		(
			r = readLine propStr ; prop = filterString r " : "
			if prop[prop.count] == "filename" or prop[prop.count] == "bitmap" do (append arr #(c, r) ; exit)
		)
		--arr.count
	) ; print arr
)
(@gazybara)
Joined: 11 months ago

Posts: 0

Above method is not acurate in most cases.
One of the case is VRayBmpFilter map which is not recognized by AssetTracking also.
Using showclass obviously not shows all class properties like showProperties method

showclass "VRayBmpFilter.*"
 VRayBmpFilter : textureMap {37d77cee,78261c3a}
  .bitmap (Spin) : bitmap
  .u_offset (Spin) : float
  .v_offset (Spin) : float
  .u_flip (Spin) : boolean
  .v_flip (Spin) : boolean
  .channel (Spin) : integer
  .u_tile (Spin) : boolean
  .v_tile (Spin) : boolean
OK

This is the rusult using showProperties method

showproperties (VRayBmpFilter())
  .bitmap (Spin) : bitmap
  .u_offset (Spin) : float
  .v_offset (Spin) : float
  .u_flip (Spin) : boolean
  .v_flip (Spin) : boolean
  .channel (Spin) : integer
  .u_tile (Spin) : boolean
  .v_tile (Spin) : boolean
  .bitmapname : string
false

Below code will recognize this map type

(
	local arr = #(), pNames = #("bitmap", "filename", "string"), skip = off
	for c in texturemap.classes where c.creatable do
	(
		propStr = stringStream ""
		showProperties (c()) to:propStr --Get all the texturemap classes. 
		seek propStr 0
		while not eof propStr do
		(
			r = readLine propStr ; prop = filterString r " : "
			idx = findItem pNames prop[prop.count]
			case idx of
			(
				(1): skip = on
				(2): (append arr #(c, r) ; skip = off ; exit)
				(3): if skip do (append arr #(c, r) ; skip = off ; exit)
			)
		)
	) ; print arr
)

Another tricky map type is Camera_Map_Per_Pixel
.zbuffer property is only one that require direct map input in the form of bitmap but not filename.
How to easy assigne map here?

Page 2 / 2