wallworm Posted July 23, 2022 Report Share Posted July 23, 2022 I would love to see a utility in GrowFX that would allow me to create a snapshot of each plant in a GrowFX node. By plant I would mean the complete mesh for each path up to the top parent. For example, in the image here, there is one GrowFX node. There is one root Point Distributor that then spawns 5 plants from 5 points. Each of the resulting meshes from those 5 root distributions would be turned into a single mesh with its pivot aligned to the transform of that plant. It would be nice to have this exposed as both a button in the modify tab as well as exposed to MAXScript. In a MAXScrtip call it would be nice to have: <node> GrowFX2.GetMeshes() returns array of the nodes created from the function. Thanks for the consideration! Quote Link to comment Share on other sites More sharing options...
Eduard Posted August 20, 2022 Report Share Posted August 20, 2022 Hi wallworm, Apologize for the delay in replying! There is already such a button in GrowFX 2.0: Create separate objects in the Preferences parameters rollout. It just creates separate objects as you want. Thanks! Quote Link to comment Share on other sites More sharing options...
wallworm Posted August 20, 2022 Author Report Share Posted August 20, 2022 Awesome. I cannot believe I didn't notice that! I would like to propose an option to make that function have the ability to set the pivot/transform of each object to match the position/orientation of the distributor point that made each object? Right now the pivot matches the pivot of the GFX object, and this isn't ideal for assets exporting into a game. Also, is the method of that button exposed to MAXScript? Quote Link to comment Share on other sites More sharing options...
Eduard Posted August 21, 2022 Report Share Posted August 21, 2022 But the pivot seems to be created where the object has its start, just like you wanted. Have you really checked this? Ok, we'll add a MaxScript method for this feature. Thanks! Quote Link to comment Share on other sites More sharing options...
wallworm Posted August 21, 2022 Author Report Share Posted August 21, 2022 (edited) Eduard, In this example, there is one GrowFX object using a Point Distributor. There are three point distributor Points that create the yellow cones. The objects that are created have a pivot that is where the GrowFX node was (world origin in this case). When I moved them away, notice how the pivot is not at the object base, but offset. I'd like the pivots to be where the original distributor spawn was (base of each cone). In the case of a point distributor, I'd like the position and orientation to match that of the point helper that the point distributor used. Hope this makes sense. Edited August 21, 2022 by wallworm Edited to make more clear. Quote Link to comment Share on other sites More sharing options...
Eduard Posted August 25, 2022 Report Share Posted August 25, 2022 Hi wallworm, Sorry for the delay! Oh, you need a new version, which we already have. I can send you an update. What version of 3dsMax do you have? Thanks! Quote Link to comment Share on other sites More sharing options...
wallworm Posted September 30, 2022 Author Report Share Posted September 30, 2022 I didn't see your message. I'm using Max 2022/2023. Quote Link to comment Share on other sites More sharing options...
Eduard Posted October 1, 2022 Report Share Posted October 1, 2022 22 hours ago, wallworm said: I didn't see your message. I'm using Max 2022/2023. Ok, I sent you these updates. Thanks! Quote Link to comment Share on other sites More sharing options...
wallworm Posted October 10, 2022 Author Report Share Posted October 10, 2022 I just tested. The button now operates as expected. Thank you so much! I saw that the GFX interface includes functions for : getNumSequences() getNumLines() GenerateOneMesh() I expect that this is the methods that you go through to generate the meshes like in the one in the UI. I propose that the exact method that the UI uses is also exposed as a method as well. It would be nice to have an option: GenerateAllMeshes <asMesh=false> where the return value is an array of new nodes in the scene when asMesh=false and an array of trimeshes if true. Quote Link to comment Share on other sites More sharing options...
Eduard Posted October 12, 2022 Report Share Posted October 12, 2022 Hi wallworm, We've added the following maxscript methods: <growfx2>.CreateHierarchyMeshes <is_group_by_pathcolor> Returns an array of Editable poly nodes of the elements in the hierarchy. is_group_by_pathcolor : boolean - when true, the algorithm will group adjacent branches if they have the same path color. <growfx2>.CreateHierarchySplines <is_group_by_pathcolor> Returns an array of Editable spline nodes of the elements in the hierarchy. is_group_by_pathcolor : boolean - when true, the algorithm will group adjacent branches if they have the same path color. I'm already planning to release this update as a new version 2.0.1. Thanks! 1 Quote Link to comment Share on other sites More sharing options...
Eduard Posted October 12, 2022 Report Share Posted October 12, 2022 Hi wallworm, We've already released a new version and you can download it from the User panel. Thanks! 1 Quote Link to comment Share on other sites More sharing options...
wallworm Posted October 13, 2022 Author Report Share Posted October 13, 2022 Awesome. I'll test this week! Quote Link to comment Share on other sites More sharing options...
wallworm Posted October 22, 2022 Author Report Share Posted October 22, 2022 I tested the new exposed methods and I had an issue. I ran the function and hit undo a couple times. This seemed to be OK. In the MXS listener recording below, I hit undo after the first two times running the $.CreateHierarchyMeshes() method. Then I ran the function to create again but stuffed into variable s. Then I ran delete s. I then assigned s again with another call to the method but got an EXCEPTION_ACCESS_VIOLATION: $.CreateHierarchyMeshes true #($Editable_Poly:Cupressus_3_001_1_001 @ [257.438660,64.907280,0.000000], $Editable_Poly:Cupressus_3_001_2_001 @ [257.192810,69.849075,114.265289], $Editable_Poly:Cupressus_3_001_3_001 @ [287.182556,18.811779,144.575912], $Editable_Poly:Cupressus_3_001_2_002 @ [258.417938,68.139091,137.432953], $Editable_Poly:Cupressus_3_001_2_003 @ [256.248108,65.852432,160.015427], $Editable_Poly:Cupressus_3_001_3_002 @ [196.211304,65.676514,157.349869], $Editable_Poly:Cupressus_3_001_2_004 @ [253.304810,63.673962,179.984283], $Editable_Poly:Cupressus_3_001_3_003 @ [298.677460,29.907063,190.718811], $Editable_Poly:Cupressus_3_001_2_005 @ [254.182571,64.322510,199.802017], $Editable_Poly:Cupressus_3_001_3_004 @ [255.555679,132.645004,225.532196], $Editable_Poly:Cupressus_3_001_2_006 @ [257.332092,65.911949,219.440674], $Editable_Poly:Cupressus_3_001_3_005 @ [193.613007,-13.574837,249.484070], $Editable_Poly:Cupressus_3_001_2_007 @ [258.979675,66.757721,237.858826], $Editable_Poly:Cupressus_3_001_3_006 @ [298.677948,80.205109,242.760712], $Editable_Poly:Cupressus_3_001_3_007 @ [354.107910,113.332748,239.344101], $Editable_Poly:Cupressus_3_001_2_008 @ [258.659760,69.174309,255.113449], $Editable_Poly:Cupressus_3_001_3_008 @ [196.943237,88.189751,254.227020], $Editable_Poly:Cupressus_3_001_3_009 @ [159.362885,105.001373,246.191406], $Editable_Poly:Cupressus_3_001_2_009 @ [258.801208,70.954430,269.943054], $Editable_Poly:Cupressus_3_001_3_010 @ [279.488220,38.815216,276.179779], ...) $.CreateHierarchyMeshes false #($Editable_Poly:Cupressus_3_001_1_001 @ [257.438660,64.907280,0.000000], $Editable_Poly:Cupressus_3_001_2_001 @ [257.192810,69.849075,114.265289], $Editable_Poly:Cupressus_3_001_3_001 @ [287.182556,18.811779,144.575912], $Editable_Poly:Cupressus_3_001_2_002 @ [258.417938,68.139091,137.432953], $Editable_Poly:Cupressus_3_001_2_003 @ [256.248108,65.852432,160.015427], $Editable_Poly:Cupressus_3_001_3_002 @ [196.211304,65.676514,157.349869], $Editable_Poly:Cupressus_3_001_2_004 @ [253.304810,63.673962,179.984283], $Editable_Poly:Cupressus_3_001_3_003 @ [298.677460,29.907063,190.718811], $Editable_Poly:Cupressus_3_001_2_005 @ [254.182571,64.322510,199.802017], $Editable_Poly:Cupressus_3_001_3_004 @ [255.555679,132.645004,225.532196], $Editable_Poly:Cupressus_3_001_2_006 @ [257.332092,65.911949,219.440674], $Editable_Poly:Cupressus_3_001_3_005 @ [193.613007,-13.574837,249.484070], $Editable_Poly:Cupressus_3_001_2_007 @ [258.979675,66.757721,237.858826], $Editable_Poly:Cupressus_3_001_3_006 @ [298.677948,80.205109,242.760712], $Editable_Poly:Cupressus_3_001_3_007 @ [354.107910,113.332748,239.344101], $Editable_Poly:Cupressus_3_001_2_008 @ [258.659760,69.174309,255.113449], $Editable_Poly:Cupressus_3_001_3_008 @ [196.943237,88.189751,254.227020], $Editable_Poly:Cupressus_3_001_3_009 @ [159.362885,105.001373,246.191406], $Editable_Poly:Cupressus_3_001_2_009 @ [258.801208,70.954430,269.943054], $Editable_Poly:Cupressus_3_001_3_010 @ [279.488220,38.815216,276.179779], ...) s = $.CreateHierarchyMeshes true #($Editable_Poly:Cupressus_3_001_1_001 @ [257.438660,64.907280,0.000000], $Editable_Poly:Cupressus_3_001_2_001 @ [257.192810,69.849075,114.265289], $Editable_Poly:Cupressus_3_001_3_001 @ [287.182556,18.811779,144.575912], $Editable_Poly:Cupressus_3_001_2_002 @ [258.417938,68.139091,137.432953], $Editable_Poly:Cupressus_3_001_2_003 @ [256.248108,65.852432,160.015427], $Editable_Poly:Cupressus_3_001_3_002 @ [196.211304,65.676514,157.349869], $Editable_Poly:Cupressus_3_001_2_004 @ [253.304810,63.673962,179.984283], $Editable_Poly:Cupressus_3_001_3_003 @ [298.677460,29.907063,190.718811], $Editable_Poly:Cupressus_3_001_2_005 @ [254.182571,64.322510,199.802017], $Editable_Poly:Cupressus_3_001_3_004 @ [255.555679,132.645004,225.532196], $Editable_Poly:Cupressus_3_001_2_006 @ [257.332092,65.911949,219.440674], $Editable_Poly:Cupressus_3_001_3_005 @ [193.613007,-13.574837,249.484070], $Editable_Poly:Cupressus_3_001_2_007 @ [258.979675,66.757721,237.858826], $Editable_Poly:Cupressus_3_001_3_006 @ [298.677948,80.205109,242.760712], $Editable_Poly:Cupressus_3_001_3_007 @ [354.107910,113.332748,239.344101], $Editable_Poly:Cupressus_3_001_2_008 @ [258.659760,69.174309,255.113449], $Editable_Poly:Cupressus_3_001_3_008 @ [196.943237,88.189751,254.227020], $Editable_Poly:Cupressus_3_001_3_009 @ [159.362885,105.001373,246.191406], $Editable_Poly:Cupressus_3_001_2_009 @ [258.801208,70.954430,269.943054], $Editable_Poly:Cupressus_3_001_3_010 @ [279.488220,38.815216,276.179779], ...) s.count 164 delete s 164 s = $.CreateHierarchyMeshes false -- Known system exception -- ######################################################################## -- Address: 0xa348d9dc; nCode: 0x00000000C0000005 -- Desc: EXCEPTION_ACCESS_VIOLATION The thread tried to read from or write to a virtual address for which it does not have the appropriate access. -- Read of Address: 0x0000000000000000 -- ######################################################################## -- MAXScript callstack: -- thread data: threadID:14720 -- ------------------------------------------------------ -- [stack level: 0] -- In top-level -- ######################################################################## -- C++ callstack: -- (GrowFX): (filename not available): CanAutoDefer -- (GrowFX): (filename not available): GetGrowFX2Converter -- (GrowFX): (filename not available): GetGrowFX2Converter -- (MAXScrpt): (filename not available): Generic::apply -- (MAXScrpt): (filename not available): CodeTree::eval -- (MAXScrpt): (filename not available): MAXScriptException::ScopedMXSCallstackCaptureDisable::__autoclassinit2 -- (MAXScrpt): (filename not available): Primitive::apply -- (MAXScrpt): (filename not available): CodeTree::eval -- (MAXScrpt): (filename not available): SourceFileWrapper::eval -- (MAXScrpt): (filename not available): IsMAXScriptListenerInViewport -- (USER32): (filename not available): GetMenuItemCount -- (USER32): (filename not available): GetMenuItemCount -- (USER32): (filename not available): GetMenuItemCount -- (USER32): (filename not available): DispatchMessageW -- (USER32): (filename not available): CallWindowProcW -- (UIControls): (filename not available): (function-name not available) -- (UIControls): (filename not available): (function-name not available) -- (USER32): (filename not available): DispatchMessageW -- (USER32): (filename not available): DispatchMessageW -- (USER32): (filename not available): IsDialogMessageW -- (3dsmax): (filename not available): XMLAnimTreeEntry::GetUnique -- (3dsmax): (filename not available): Frustum::operator= -- (Qt5Core): (filename not available): QObject::qt_static_metacall -- (Qt5Core): (filename not available): QEventDispatcherWin32::preProcessNativeEvent -- (Qt5Core): (filename not available): QEventDispatcherWin32::processEvents -- (qwindows): (filename not available): qt_plugin_query_metadata -- (Qt5Core): (filename not available): QEventLoop::exec -- (Qt5Core): (filename not available): QCoreApplication::exec -- (3dsmax): (filename not available): Frustum::operator= -- (3dsmax): (filename not available): NodeAndAnims::SetNode -- (3dsmax): (filename not available): UtilGfx::InitRectIPoint3 -- ######################################################################## Quote Link to comment Share on other sites More sharing options...
wallworm Posted April 20 Author Report Share Posted April 20 @Eduard The updated functions you added a while ago are great. It would be nice to expose to MAXScript the function of the Create Separate Objects button (I could only see exposure to the create Hierarchy of Meshes and Splines) and make it return the results. Also, it would be convenient if you could make two versions of the function: 1) One that matches current button that makes editable poly objects ; 2) a version that returns an array of trimesh() data (not scene nodes). 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.