Cross sections tool was the very first plugin for Maya I wrote in C++. After using this amazing tool daily for 5 months I realized it’s time for upgrade.
What’s new
From the outside it may look just like the old Section tool, in the end it’s supposed to to do the same thing, but starting from scratch helped me to bring in some new features (also cost me a lot of sleepless nights):
- Cross sections 2.0 supports all types of geometry – Meshes, NURBS and subdivision surfaces. Smoothness/resolution of the sections depends on display options of the input geometry.
- Geometry can be added to existing node and also removed from it any time.
- Plugin can generate actual NURBS curves.
- New analytic features – Curvature comb and distance measuring.
- Improved performance
- This handsome icon
Fixed bugs
The main reason I wrote the new version were these bugs:
- Vieport 2.0 support – As much as I hate writing VP 2.0 overrides I had to fix this one because of my friend who’s been bothering me about VP 2.0 support since the very beginning.
- Placement and orientation of the custom manip is now based on the world matrix of the Cross Sections node instead of parent’s local matrix (seriously, what did I think?)
- New node is by default placed in the center of a bounding box containing all the input geometry. The position used to be based on intersection of the view vector with the input geometry, which often didn’t work correctly (when it worked it was actually pretty awesome).
How to use
command (MEL): crossSections
Command creates a crossSections locator and automaticaly connects all selected geometry as input geometry. Node’s attributes can be set/queried using following flags.
Long name (shortName) | Argument type | Properties |
---|---|---|
-numberOfPlanes (-n) | int | |
Sets/query number of section planes. | ||
-planeSpacing (-s) | float | |
Set/query spacing of section planes. Actual spacing also depends on scale of tool's transform. | ||
-translate (-t) | float float float | |
Set/query translation of tool. Default is center of geometry's bounding box. | ||
-rotate (-r) | float float float | |
Set/query rotation of tool. Default direction is vector X. | ||
-addGeometry (-add) | string | |
Add geometry to existing tool. Flag can be used multiple times in one command. | ||
-remove (-rem) | int | |
Remove inputs from from existing tool. Flag can be used multiple times in one command. | ||
-inputs (in) | int array | |
Return list containing indices of all existing inputs. | ||
-objects (-obj) | string array | |
Return list containing names of all connected objects. | ||
-curves (-crv) | int | |
Create nurbs curves for given input. Flag can be used multiple times in one command. | ||
-lineWidth (-lw) | float | |
Set/query section line width (doesn't affect curvature comb thickness). | ||
-curvatureComb (-cc) | bool | |
Set/query curvature comb display status. | ||
-combSamples (-csp) | int | |
Set/query number of curvature comb samples. | ||
-combScale (-csc) | float | |
Set/query curvature comb scale. | ||
-combSmooth (-csm) | bool | |
Set/query curvature comb smoothing status. | ||
-combSmoothRadius (-csr) | int | |
Set/query curvature comb smoothing radius. Higher values provide smoother but less accurate comb. |
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 |
polyCube -n "cube1"; crossSections -n 5 -s 100 -r 0 0 90 "sections"; // Creates node with 5 section planes, 100 units far from each other in Y direction using "cube1" as an input geometry polyCube -n "cube2"; crossSections -e -add "cube2" "sections"; // Adds "cube 2 to input geometry" crossSections -q -in "sections"; // Returns {0, 1} crossSections -q -crv 0 -crv 1 "sections"; // Creates group containing section curves of both cubes |
28 Comments
Kaveh
27 Mar 2022 - 5:36 pmDear Stepan,
Thanks a lot for creating such a useful and fantastic tool. It makes the design and modeling process so much easier.
I have a question:
– Does this plugin work for Maya 2022, too?
I have been able to install it and now I can see the icons in maya shelf bar on top, however, nothing happens when I click on them.
I should be very happy if you could help me with this issue.
Thanks in advance for your time and looking forward to hearing from you soon.
Best regards
Matt Weier
16 Feb 2021 - 6:46 pmI made some progress in batch generating cross sections for each frame in an animated blendshape sequence.
1) Is there any command I can run to create the curve from the cross section generated each frame within my FOR loop?
2) is there any way to generate paint effects strokes for the curve that’s created within the for loop, keyframing their visibility to the current frame $r?
int $startTime = 1;
int $endTime = 90;
currentTime $startTime;
select -clear;
for ($r = $startTime; $r <= $endTime; $r++){
currentTime $r;
string $newName = ("topo" + $r);
print($newName);
select -clear;
select -r morphMountains ; // insert your morphin geometry name here
crossSections -n 100 -s 0.1 -r 0 0 90 -t 0 -1.5 0 $newName;
}
Stepan Jirka
18 Feb 2021 - 7:31 amHi Matt,
I cant really help you with your problem. It has fairly limited functionality since it was meant to be a modeling tool rather than a tool for visualisation.
Best
Stepan
Matt Weier
16 Feb 2021 - 5:34 pmso cool! This opens so many possibilities, but the inability to render them is a huge bummer. I also have noticed that applying this to the result of blendshapes does not respect any topology changes caused by the blendshapes – the profile curves are locked to the state of the mesh when the command was run.
Is there any way to automate generation of curves on each frame to cache renderable curves out for use in nHair rendering?
Mauricio
17 Jul 2020 - 6:38 amDear Stepan
Does the Cross Sections 2.1.1 for Maya just works with legacy viewport?. I installed the plugin and this is the only issue I got. It says VP 2.0 not supported. Do you have an update version?.
Pd: I am using maya 2019.
Many thanks.
Mauricio V.
Stepan Jirka
17 Jul 2020 - 6:44 amHi Mauricio,
the visual clipping only works in legacy view-port, it wasn’t technically possible in VP 2.0 (at least I wasn’t able to find a way to implement it).
Stepan
leandro pinho
18 Aug 2018 - 1:08 amhow can I render a cross section?
Stepan Jirka
20 Aug 2018 - 7:34 amHi Leandro,
unfortunately the cross section is only visible in viewport. There’s a function in the UI to bake the sections as curves though.
Best regards
Stepan
Dan Wright
15 Aug 2018 - 5:16 pmStepan-
I’m still quite interrested in getting your plugin up in my Maya 2018 on Windows 7 x64. Unfortunately it looks like the files you’ve provided are not complete. My build fails because of a missing macros.h, there is no icon, and since the video clip shows some custom UI panel shouldn’t there be at least a qml file too?
If you post a complete archive I’m sure a lot of people would begin using your great plugin!
Thanks,
Dan
Stepan Jirka
15 Aug 2018 - 6:55 pmHi Dan,
sorry for letting you wait.
First of all this tool has already become industry standard, so I guess most of people did’t have problem using it. Please don’t forget I’m giving away all my plug-ins for free and providing support to each of you while I’m also doing my fulltime job is impossible.
As for your questions:
1) This release already contains x64 2018 version (I just uploaded the missing macro.h file on my github in case you’d prefere to compile it yourself)
2) icons can be found in the release archive in “prefs/icons”
3) the GUI is an Attribute editor template, which is in “scripts/AEcrossSectionsTemplate.mel”
Best regards
Stepan
Dan Wright
30 Jul 2018 - 12:30 amActually I have since found your library in your github. However macros.h is still missing…
Dan Wright
29 Jul 2018 - 11:08 pmAlso your handsome icon is not included. Is your archive complete?
Dan Wright
29 Jul 2018 - 11:06 pmHi Stepan-
Your plugin looks extremely useful and I’m quite interested in building this for Maya 2018 on Windows 7 x64. I created an empty Maya plugin project in VS2015 using the Maya plugin wizard. Adding all of your sources I find that I’m missing “SSectionPlane.h” and also some “_library” directory? Any idea what this issue might be?
Thanks!
Dan
1> pluginMain.cpp
1>c:\avtd\maya\vtdcrosssections\CrossSectionsNode.h(3): fatal error C1083: Cannot open include file: ‘SSectionPlane.h’: No such file or directory
1> DistanceToolCmd.cpp
1> DistanceSectionManip.cpp
1>..\DistanceSectionManip.cpp(4): fatal error C1083: Cannot open include file: ‘../_library/SPlane.h’: No such file or directory
1> DistanceManipContainer.cpp
1>c:\avtd\maya\vtdcrosssections\CrossSectionsNode.h(3): fatal error C1083: Cannot open include file: ‘SSectionPlane.h’: No such file or directory
1> DistanceContext.cpp
1>c:\avtd\maya\vtdcrosssections\CrossSectionsNode.h(3): fatal error C1083: Cannot open include file: ‘SSectionPlane.h’: No such file or directory
1> DistanceCmd.cpp
1> CrossSectionsPlaneManip.cpp
1>c:\avtd\maya\vtdcrosssections\CrossSectionsNode.h(3): fatal error C1083: Cannot open include file: ‘SSectionPlane.h’: No such file or directory
1> CrossSectionsNode.cpp
1>c:\avtd\maya\vtdcrosssections\CrossSectionsNode.h(3): fatal error C1083: Cannot open include file: ‘SSectionPlane.h’: No such file or directory
1> CrossSectionsManipContainer.cpp
1>..\CrossSectionsManipContainer.cpp(1): fatal error C1083: Cannot open include file: ‘../_library/SCamera.h’: No such file or directory
1> CrossSectionsDrawOverride.cpp
1>c:\avtd\maya\vtdcrosssections\CrossSectionsNode.h(3): fatal error C1083: Cannot open include file: ‘SSectionPlane.h’: No such file or directory
1> CrossSectionsCommand.cpp
1>c:\avtd\maya\vtdcrosssections\CrossSectionsNode.h(3): fatal error C1083: Cannot open include file: ‘SSectionPlane.h’: No such file or directory
1> Generating Code…
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
Stepan Jirka
30 Jul 2018 - 4:54 amHi Dan,
I’m currently on holiday, I’ll try to help you when I’m back.
Thank you for your patience
Štěpán
GooDroN
30 May 2018 - 8:22 amGood day!!!
Cutoff effect is not rendered?!? (Arnold, Redshift…)
Robert
25 Jan 2018 - 8:49 pmAny chance this could work in the 2015 version?
Great looking tool!
Stepan Jirka
25 Jan 2018 - 9:08 pmHi Robert,
I’ll try to find a devkit for 2015 and compile for 2015. Stay tuned.
Best regards
Stepan
Robert
25 Jan 2018 - 9:12 pmI would be so delighted, thank you!
Matt r
12 Jul 2017 - 8:21 pmGreat tool! …but I am missing where to apply the cross section for rendering? I only get a solid object when rendered
Stepan Jirka
13 Jul 2017 - 5:49 amHi Matt,
I’m afraid you can’t render the cross sections because it’s a locator so it only shows in a viewport.
Best
Štěpán
Rodrigo
25 Feb 2017 - 6:30 pmHi Stepan, thanks for your replay.
But I couldn’t download it. Something is wrong. I can’t see the icons on the workspace.
and I have diferents folders, I don’t know if that is one of the reason what doesn’t work:
C:\Program Files\Autodesk\Maya2017\bin\plug-ins
C:\Program Files\Autodesk\Maya2017\scripts
C:\Program Files\Autodesk\Maya2017\icons
Stepan Jirka
25 Feb 2017 - 6:36 pmYou’re not supposed to see any icons. Folders you mentioned should work fine. Did you manage to load the plugin in plugin manager? After that you just select geometry and run the crossSections command.
Rodrigo
25 Feb 2017 - 10:05 amHi.
I would like to install the crossSections plugin, I have Maya 2017 but I don’t how can do it.
Could you help me?
Thanks
Stepan Jirka
25 Feb 2017 - 10:23 amHi Rodrigo
copy files into following folders:
crossSections_2.1_2017.mll in C:\Users\username\Documents\maya\2017\plug-ins\
AEcrossSectionsTemplate.mel in C:\Users\username\Documents\maya\2017\scripts\
and content of icons folder in C:\Users\username\Documents\maya\2017\prefs\icons\
Load the plug-in in Windows>Settings/Preferences>Plug-in manager and use the tool through crossSections command as described above.
Matthias
15 Feb 2017 - 3:48 pmHallo,
thank you!
missing the visual clip function under maya 2017?
did i miss something?
Stepan Jirka
15 Feb 2017 - 4:09 pmHi Matthias,
It turned out I attached the wrong AE template. Thanks for pointing this out. Please download the file again. Btw visual clip works only in legacy viewport on meshes with Maya Catmull-Clark smoothing method.
Mike Tiderington
14 Feb 2017 - 6:54 pmI have this horrible feeling that ALL these very cool scripts are Windows only ?
Stepan Jirka
14 Feb 2017 - 7:01 pmYou’re unfortunately right…