scaron Posted June 19, 2014 Report Share Posted June 19, 2014 hello i am not very experienced 3dsmax programmer. i was wondering if growfx comes with its own 'get' or 'getall' method for accessing existing growfx objects? in the docs i see how to construct a new one and programmatically build a tree up, what i need to do is run a script on an existing one, which will enable and disable certain mesh modifiers and then export the meshes to obj for use in another application. thanks steven Quote Link to comment Share on other sites More sharing options...
scaron Posted June 19, 2014 Author Report Share Posted June 19, 2014 i have another question about inspecting the paths and mesh builders on the paths by modifier type. right now i know the names of each path and modifier but i need to get them by type. ie. for all paths get their mesh builder modifiers and if the modifier is not leaves mesh, disable it. here is my current code, it has hard coded property names... for item in selection do( if classOf(item) == GrowFX do( gfx = item; gfx.trunk.Meta_mesh_01.Enabled = false; gfx.branches_1.Meta_mesh_01.Enabled = false; gfx.branches_2.Meta_mesh_01.Enabled = false; gfx.branches_3.Cylinder_mesh_01.Enabled = false; gfx.leaves.Leaves_mesh_01.Enabled = true; -- force update gfx.Update() ) ) Quote Link to comment Share on other sites More sharing options...
Eduard Posted June 20, 2014 Report Share Posted June 20, 2014 Hi Steven, Yes, some MaxScript functions are not yet available in GrowFX, because few people use it. However, we can add the necessary functions and properties... If you have any more wishes regarding the MaxScript functionality, please let us know, we'll add it. Thanks! Quote Link to comment Share on other sites More sharing options...
Eduard Posted June 20, 2014 Report Share Posted June 20, 2014 i have another question about inspecting the paths and mesh builders on the paths by modifier type. right now i know the names of each path and modifier but i need to get them by type. ie. for all paths get their mesh builder modifiers and if the modifier is not leaves mesh, disable it. You can check the component type as follows: if classOf(gfx.trunk.Meta_mesh_01) == GrowFX_sMESH_Meta do ( ... Here's a list of types for the Mesh builders: GrowFX_sMESH_Cyl GrowFX_sMESH_Meta GrowFX_sMESH_Leafs GrowFX_sMESH_IG GrowFX_sMESH_STDLeafs Cheers! Quote Link to comment Share on other sites More sharing options...
scaron Posted June 20, 2014 Author Report Share Posted June 20, 2014 thanks eduard is this the proper way to get lists of properties/modifiers? for item in selection do( if classOf(item) == GrowFX do( gfx = item; props = getPropNames(gfx); for prop in props do( p = getProperty gfx prop; if classOf(p) == GrowFX_sPath do( pathProps = getPropNames(p); for pathProp in pathProps do( m = getProperty p pathProp; if classOf(m) == GrowFX_sMESH_Meta do( m.Enabled = false; ) ) ) -- force update gfx.Update(); ) ) ) Quote Link to comment Share on other sites More sharing options...
Eduard Posted June 20, 2014 Report Share Posted June 20, 2014 Hi Steven, Yesterday, we added the following functions: getPath <path_index_integer> Returns the indexed path, index are 1-based. getDistributor <path_index_integer> <distributor_index_integer> Returns the indexed distributor for the specified path, indexes are 1-based. getModifier <path_index_integer> <modifier_index_integer> Returns the indexed modifier for the specified path, indexes are 1-based. getMeshBuilder <path_index_integer> <mesh_index_integer> Returns the indexed mesh builder for the specified path, indexes are 1-based. getAfterMeshModifier <path_index_integer> <aftermeshmodifier_index_integer> Returns the indexed after mesh modifier for the specified path, indexes are 1-based. I hope this is the best way to get a components list... What do you think about this? Thanks! Quote Link to comment Share on other sites More sharing options...
scaron Posted June 20, 2014 Author Report Share Posted June 20, 2014 i guess we would need an indexing function? like, getNumPaths? or getPathCount? etc etc or it could be getPaths and it returns an array of path objects? Quote Link to comment Share on other sites More sharing options...
Eduard Posted June 20, 2014 Report Share Posted June 20, 2014 i guess we would need an indexing function? like, getNumPaths? or getPathCount? etc etc or it could be getPaths and it returns an array of path objects? Yes you are right! We'll add these functions... Regarding the arrays, yes we wanted to implement this, but I don't understand how to do it in the Max SDK, because I've not found an example... Thanks! Quote Link to comment Share on other sites More sharing options...
scaron Posted June 20, 2014 Author Report Share Posted June 20, 2014 getNumPaths and getPaths are fine... for i = 0 to getNumPaths() do ( path = getPath(i); print(path); ) Quote Link to comment Share on other sites More sharing options...
Eduard Posted June 20, 2014 Report Share Posted June 20, 2014 getNumPaths and getPaths are fine... Yes, now we'll add these functions Quote Link to comment Share on other sites More sharing options...
Eduard Posted June 20, 2014 Report Share Posted June 20, 2014 Ok, we've added the following functions: getNumPaths() Returns the number of paths. getNumDistributors <path_index_integer> Returns the number of distributors for the specified path, index are 1-based. getNumModifiers <path_index_integer> Returns the number of modifiers for the specified path, index are 1-based. getNumMeshBuilders <path_index_integer> Returns the number of mesh builders for the specified path, index are 1-based. getNumAfterMeshModifiers <path_index_integer> Returns the number of after mesh modifiers for the specified path, index are 1-based. Now you can try this code: gfx = $ for i = 1 to gfx.getNumPaths() do ( path = gfx.getPath i; format "%\n" (classOf(path)); format " Distributors:\n" for j = 1 to (gfx.getNumDistributors i) do ( distr = gfx.getDistributor i j; format " %\n" (classOf(distr)) ) format " Modifiers:\n" for j = 1 to (gfx.getNumModifiers i) do ( dir = gfx.getModifier i j; format " %\n" (classOf(dir)) ) format " MeshBuilders:\n" for j = 1 to (gfx.getNumMeshBuilders i) do ( mb = gfx.getMeshBuilder i j; format " %\n" (classOf(mb)) ) format " AfterMeshModifiers:\n" for j = 1 to (gfx.getNumAfterMeshModifiers i) do ( amm = gfx.getAfterMeshModifier i j; format " %\n" (classOf(amm)) ) ) Please contact me by email, and I'll send you an update... Thanks! Quote Link to comment Share on other sites More sharing options...
scaron Posted June 21, 2014 Author Report Share Posted June 21, 2014 awesome, thanks! Quote Link to comment Share on other sites More sharing options...
scaron Posted June 24, 2014 Author Report Share Posted June 24, 2014 i sent an email but haven't heard back... Quote Link to comment Share on other sites More sharing options...
Eduard Posted June 24, 2014 Report Share Posted June 24, 2014 i sent an email but haven't heard back... Sorry, but your message was detected as spam... Now I'll send you an update! Quote Link to comment Share on other sites More sharing options...
scaron Posted June 26, 2014 Author Report Share Posted June 26, 2014 thanks, the changes to the API are working as expected! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.