Author Topic: How do I get rid of HdCache.hdc to make rebusfarm happy?  (Read 4898 times)

2017-11-13, 17:36:09

Ankerite

  • Active Users
  • **
  • Posts: 15
    • View Profile
Sorry, but how do you delete asset which don't exist?

2017-11-13, 18:04:00
Reply #1

PROH

  • Active Users
  • **
  • Posts: 1219
    • View Profile
Hi. Had the same problem with the hdc-file. It's coming from an old version of Corona, so either this is an old file, or your maxstart file contain it (in my case it was the latter).

The only way I've found to get rid of it, is to switch the renderer to something else (i.e. Scan line), clean the assets, save the file, reopen the file and switch the renderer back to Corona. The render settings will of course change back to default, so write them down before doing this.

Hope it helps

2017-11-14, 05:13:30
Reply #2

Ankerite

  • Active Users
  • **
  • Posts: 15
    • View Profile
Hi. Had the same problem with the hdc-file. It's coming from an old version of Corona, so either this is an old file, or your maxstart file contain it (in my case it was the latter).

The only way I've found to get rid of it, is to switch the renderer to something else (i.e. Scan line), clean the assets, save the file, reopen the file and switch the renderer back to Corona. The render settings will of course change back to default, so write them down before doing this.

Hope it helps

Worked like a charm, thank you :)

2017-11-14, 10:53:24
Reply #3

SHORT CUTS

  • Active Users
  • **
  • Posts: 83
    • View Profile
    • SHORT CUTS
You dont need to switch the renderer, just pretend that you want to use "load from file" instead of "calculate from scratch" so you gain access to the filename field and delete whatever is in there, afterwards switch back to calculate from scratch.

2017-11-14, 11:01:39
Reply #4

PROH

  • Active Users
  • **
  • Posts: 1219
    • View Profile
Yes! I simply forgot that. Much easier :) Thanks.

2017-11-20, 13:04:45
Reply #5

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 9048
  • Turning coffee to features since 2009
    • View Profile
contacted rebus about this
Rendering is magic.How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)

2018-03-11, 20:33:26
Reply #6

3dwannab

  • Active Users
  • **
  • Posts: 362
    • View Profile
I have the same problem only I found this still exists in the AssetMetadata of the max file which is not removed/handled by Corona.

See excerpt from the metadata which is not listed in Max Asset Tracking showing filename:"HdCache.uhd"
Code: [Select]
(AssetMetadata_StructDef assetId:"{CD94B2BE-D5E2-4430-A30A-DEC169117561}" filename:"HdCache.uhd" type:#animation resolvedFilename:"")

To me, it looks like the filename: portion is not getting updated whereas resolvedFilename: is fine and gets updated when you update the file in the render dialog.

For the guys/girls above your problem can be solved easily by running this line in the listener which will remove it from the Asset Tracking (Not the metadata, it will still exist there).
It clears the path for the uhd path.
Code: [Select]
renderers.current.gi_uhdCache_file = ""
Ondra, shall I post this on the bugtracker?



For those that want to check run this (change the path between the quotes and point to your .max file) and search for type:#animation.
Code: [Select]
getMAXFileAssetMetadata "C:\Assets\Models\Maxstart.max"
« Last Edit: 2018-03-11, 22:18:30 by 3dwannab »

2018-03-13, 12:00:27
Reply #7

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12768
  • Marcin
    • View Profile

2018-03-13, 12:08:59
Reply #8

3dwannab

  • Active Users
  • **
  • Posts: 362
    • View Profile
I was thinking of mass editing directories so I wrote a script which should remove that array. But setMaxFileAssetMetadata isin't working like I thought it should.

I've asked why here:
http://www.scriptspot.com/forums/3ds-max/general-scripting/using-setmaxfileassetmetadata-but-not-sticking

Here's the code I posted asking the Q (maybe Deadclown may be of help or other scripters or Corona Team)
PLEASE, DO NOT USE, IF SO. TEST FILES ONLY
Code: [Select]
-- Maxfile to get metadata
theMaxFile = @"C:\\Users\\username\\Documents\\3dsMax\\scenes\\Maxstart - Copy.max"
 
-- Get the metadata
oldMetaArray = getMAXFileAssetMetadata theMaxFile
 
-- Format print the old metadata
for i in oldMetaArray do (format "\nOLD METADATA: %" i)
 
-- Search for an array where there's not string matching "type:#animation resolvedFilename" and collect
NewmetaArray = for i in oldMetaArray where not matchpattern (i as string) pattern:"*type:#animation resolvedFilename*" collect i
 
-- Set theMaxFile with the NewmetaArray
setMaxFileAssetMetadata theMaxFile NewmetaArray
 
-- Check the theMaxFile metadata. Opps! Still the same.
for i in oldMetaArray do (format "\nNEW METADATA, STILL THE SAME: %" i)

2018-05-09, 20:25:32
Reply #9

3dwannab

  • Active Users
  • **
  • Posts: 362
    • View Profile
I've managed to get that working. Here's the code to remove that asset completely from the metadata and ATSOps in the time it takes to save the file. Comments in the code.

No reopening is necessary.

Code: [Select]
/* Script to remove the *.hdc file from corona renderer whether missing or not.
Written by 3dwannab
v1.0 - 09/05/20018
*/
-- clearlistener()
if classof renderers.current == CoronaRenderer then (
-- Clear from render settings
renderers.current.gi_uhdCache_file = ""
--update asset tracking
ATSOps.refresh()
-- Get current maxfile
current_filename = (maxFilePath + maxFilename)
-- Create empty array
fileassets = #()
-- Retrieves all fileassets from current_filename var
fileassets = getMAXFileAssetMetadata current_filename
-- Search in above array where there's a string matching "*filename:\"*.hdc\" type:#animation resolvedFilename:\"*\"*" and collect it
ReleaseReference_Id = (for i in fileassets where matchpattern (i as string) pattern:"*filename:\"*.hdc\" type:#animation resolvedFilename:\"*\"*" collect i.assetId)[1]
-- ReleaseReference_Filename = (for i in fileassets where matchpattern (i as string) pattern:"*filename:\"*.hdc\" type:#animation resolvedFilename:\"*.hdc\"*" collect i.FileName)[1]
-- Releases the reference found in ReleaseReference_Id array
try(AssetManager.ReleaseReference ReleaseReference_Id)catch(print "No cache file found...")
-- Needed to update file only if ReleaseReference_Id not undefined
if ReleaseReference_Id != undefined then (
savemaxfile current_filename
-- Garbage collection
gc light:true
)
)
« Last Edit: 2018-05-09, 23:06:29 by 3dwannab »