Summary

Title:Ornatrix Error: Assert failed (4): vertexSampleCount > 0
Category:Crash/Critical
Status:Open
Posted By:BenSen ( Benjamin Schiefer )
Date Created:26 July 2024

Problem

Description:

Hi,

I have written a maxscript which calls the .record function of a Ox_Animation_Cache modifier to cache the animation to disk.
Unfortunately this works flawlessly with the demo version of the plugin, which I have installed, but throw errors like:

Ornatrix Error: Assert failed (4): vertexSampleCount > 0

when run on a workstation of my client who uses the licensed version of the plugin. Here is the maxscript code (in essence) that produces the errors:

myModifier.record animationRange.start animationRange.end

The caching does work correctly when manually pressing the "Record active time range" button in the modify panel.

Any help would be appreciated. Thanks!

Steps to Reproduce:

Hi,

Can you please show me a screenshot of the modifier stack? 

Jeordanis Figuereo (Product Designer. EPHERE Inc.)

The error means that at the end of the recording there were no samples recorded and there's nothing to save.

The plugin version (demo vs commercial) is irrelevant.

Is the scene exactly the same in both cases? If the scene is the same, and the only difference between the two workstations is the plugin version (or Max version), I can't see how could they behave differently. Except maybe if some global 3ds Max settings are different (like ticks per frame), but it seems unlikely.

And yes, any additional info might be useful, like the modifier stack, or the scene itself if possible, or the Ornatrix log file.

 

Ivan Kolev (Software Developer, EPHERE Inc.)

E-mail: ivan.kolev at ephere dot com

Discord: ikolev

Thank you for your reply.

 

"The plugin version (demo vs commercial) is irrelevant."

Well, in the demo version I can not set the ".animFilename" property of the modifier through maxscript as it is a "read-only" property. This is not true in the commercial version, so I figured there are some differences in both version. Anyways...

"Is the scene exactly the same in both cases?"

Yes, it is the same scene!

 

I attach a screenshot of the modifier stack. I can not send you the scene file since it is property of my client, sry. I also do not have a log file, again sorry.
We actually solved the problem by using UIAccessor in maxscript to "virtually" press the button "Record Active Time Range" in the modifiers UI.
This works as does pressing the button manually. Just using the .record function in the script does show the errors. And, as I said, this only happens
in the full version on the workstation of my client. I can use the .record function just fine here with the demo version...but can not set the .animFilename property
on the demo version (read-only) but this works on the full version...Tongue Out

So. I think my client is satisfied with the workaround but I really think that there might be a bug in the plugin at that point. However, I can not sent you any more
data, as I said.
Thanks for your help so far.
Best regards
Ben


Attached Files:
Image 1

"in the demo version I can not set the ".animFilename" property of the modifier through maxscript as it is a "read-only" property"

Right, I forgot about that limitation in the demo version. But anyway, if something works in the demo version, it doesn't make sense that it wouldn't work in the commercial one, as the demo is only more limited.

What might cause some difference in the behavior is the version number, that is if the two machines have different versions installed (usually the demo version matches the stable version number, but the commercial version also has nightly builds).

One detail about the script: it must set the Command Panel to the Modify tab, recording may not work otherwise. Our test script uses the "max modify mode" command to do that.

Here's our full test script:

 

function Test_Recording =
(
local distributionObject = Plane lengthsegs:1 widthsegs:1 isSelected:on
local alembicFilePath = TestUtilities.GetTestFilePath "Test_Recording.abc"
-- Delete the test file from any previous runs
if (doesFileExist alembicFilePath) then deleteFile alembicFilePath

max modify mode
local bendInstance = AddAnimatedBendToSelection()
TestUtilities.AddDefaultGuidesFromSurfaceModifierToSelection()

local verticesOverTimeOnOriginalGuides = TestUtilities.GetHairVerticesOverTime distributionObject 0 5

-- Add strand animation modifier on top and load the saved .abc file
local strandAnimationModifierInstance = Ox_Animation_Cache animFilename: alembicFilePath endframe: 5
modPanel.addModToSelection strandAnimationModifierInstance

strandAnimationModifierInstance.Record 0f 5f

-- Turn off Bend modifier and check results again
bendInstance.enabled = off
local verticesOverTimeOnAnimatedGuides = TestUtilities.GetHairVerticesOverTime distributionObject 0 5

-- Check that points were loaded properly
for i = 1 to (verticesOverTimeOnOriginalGuides.count) do
(
EAssert.ArePointsAllNearEqual verticesOverTimeOnOriginalGuides[i] verticesOverTimeOnAnimatedGuides[i]
)

-- Cleanup
deleteFile alembicFilePath
)
<code> </code>

Ivan Kolev (Software Developer, EPHERE Inc.)

E-mail: ivan.kolev at ephere dot com

Discord: ikolev

"One detail about the script: it must set the Command Panel to the Modify tab, recording may not work otherwise. Our test script uses the "max modify mode" command to do that."

That might probably be the cause for the error! Thank you for that.