Itoo Software Forum

Forest Pack => Forest Pro (*) => Topic started by: Pierre on August 18, 2015, 11:21:58 AM

Title: Corona render and forest material
Post by: Pierre on August 18, 2015, 11:21:58 AM
Hello,
Forest material is not supported by corona and the corona material converter is not able to convert this material. Is there a trick or a script for doing this ?
I have a lot of them to do :)
Thank you
Pierre
Title: Re: Corona render and forest material
Post by: 3dwannab on August 18, 2015, 02:01:11 PM
++1 not sure if this would need to be implemented on Coronas side too. I think I read somewhere on their forum that's the case.
Title: Re: Corona render and forest material
Post by: iToo on August 19, 2015, 10:00:18 AM
This script may help. It removes Forest Material from the scene, replacing them by their "Base Material" (usually a Standard mat.) which is renderable by Corona:

Code: [Select]
function removeForestMaterial mat parent slot =
(
case (classof mat) of
(
Multimaterial:
(
local i
for i = 1 to (getNumSubMtls mat) do
removeForestMaterial (getSubMtl mat i) mat i
)
Forest_Material:
(
if mat.material1 != undefined then
(
mat.material1.name = mat.name
if parent == undefined then
replaceInstances mat mat.material1
else
setSubMtl parent slot mat.material1
)
)
)
)

function processSceneMaterials =
(
local i
for i = 1 to (sceneMaterials.count) do
(
removeForestMaterial sceneMaterials[i] undefined 0
)
)

processSceneMaterials()

Forest Material is used exclusively for 2D trees, that are not directly supported in Corona. Anyway they can be rendered as standard objects, applying a "Select mesh" or "Edit mesh" to the Forest object, and removing Forest Material with the above script. Some features of billboards as fake shadows or tint will not be available, but at least you can render them.

I hope that helps.