Forum

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - MetaUser555

Pages: [1] 2
1
Python and Java API / Re: Import model script help
« on: October 21, 2024, 06:00:24 PM »
Thanks Alexey!
We fixed it a different way to this so all good
As a side note, would you be able to add 'import model' to the batch process ui? It's not there but would be very useful
thanks for all the help

2
Python and Java API / Import model script help
« on: October 18, 2024, 11:39:52 PM »
Hello there,
I have this script

import Metashape
import os

# Access the current project document
doc = Metashape.app.document

# Get the project folder and construct the export path
project_folder = doc.path
export_folder = os.path.join(project_folder, "..", "export")

# Loop through all chunks in the project
for chunk in doc.chunks:
    # Construct the model path using the chunk label
    model_path = os.path.join(export_folder, f"{chunk.label}.abc")
    model_format = Metashape.ModelFormatABC

    # Import the model into the current chunk
    chunk.importModel(model_path, format=model_format)

it runs but gives me an error, saying:
2024-10-18 16:33:45 ImportModel: path = N:/Projects/projectFiles/model.psx\..\export\model.abc, format = ModelFormatABC
2024-10-18 16:33:45 Finished processing in 0.001 sec (exit code 0)
2024-10-18 16:33:45 Traceback (most recent call last):
2024-10-18 16:33:45   File "X:/metashape/impmod.py", line 18, in <module>
2024-10-18 16:33:45     chunk.importModel(model_path, format=model_format)
2024-10-18 16:33:45 Exception: IArchive::IArchive( iFileName )
2024-10-18 16:33:45 ERROR: EXCEPTION:
2024-10-18 16:33:45 Could not open as Ogawa file: N:/Projects/projectFiles/model.psx\..\export\model.abc
2024-10-18 16:33:45 Error: IArchive::IArchive( iFileName )
2024-10-18 16:33:45 ERROR: EXCEPTION:
2024-10-18 16:33:45 Could not open as Ogawa file: N:/Projects/projectFiles/model.psx\..\export\model.abc


can you tell me what I'm doing wrong?
cheers

3
General / Re: Batch commands in UI for Pathing
« on: July 05, 2023, 12:29:27 AM »
Thanks Alexey,
A bit more information - this works when I run it locally but when I run it over the network machines it errors out like above
cheers

4
General / Batch commands in UI for Pathing
« on: June 15, 2023, 07:18:54 PM »
Hi there,
I'm putting this into the Path section of the batch ui
{projectpath}/export/{chunklabel}.abc
was expecting just the project path but when it's run i get:
Error: Can't make path: The filename, directory name, or volume label syntax is incorrect (123):
it's appending the correct path from above with this:
C:/Users/me/Desktop/
is there something I'm missing in the batch command?
Metashape Pro 2.0.1
thanks for your help

5
General / batch saving frames
« on: February 03, 2023, 02:14:45 AM »
{frame} using this in my batch export the numbering goes from 1. Is there a way to pad this out so it starts with a defined amount of characters so we could start at 0001 from the batch?

6
General / Re: 16bit images in - 8bit texture out?
« on: September 20, 2019, 04:14:30 PM »
thanks for the reply but Tifs are the format i need in 8bit
cheers

7
General / 16bit images in - 8bit texture out?
« on: September 20, 2019, 12:19:43 AM »
Hi, just wanted to know if there is a way to force an image to export as an 8bit tif even if you have the model built with 16bit images.
There doesn't seem to be any option to select bit depth.
I'm trying to reduce file sizes and I don't need a 16bit image as the exported texture file - I'm using RAW files as the processing images from a dslr.
thanks for any help!

8
Python and Java API / Script to increase region by 2x
« on: August 16, 2019, 12:22:18 AM »
Hi,
I was looking for a simple python script to increase the size of the region by 2x so i'm not cutting off any part of the model during the dense cloud process
I've looked on the forum but all seem to be pretty specific to their own needs, just looking for a simplified version
Thanks for any help!

9
General / Re: obj corrupted on export
« on: December 04, 2017, 07:52:28 PM »
Excellent - it was a rouge marker that was throwing it off, i removed all markers and went through the process again and all is good. Wood for the trees!
Thanks for your help!

10
General / Re: obj corrupted on export
« on: December 04, 2017, 05:53:47 PM »
mtllib rat1.mtl
usemtl rat1
v -46.128224 16.237158 -6356780.627627
v -46.251848 16.450610 -6356781.066125
v -45.451169 15.283114 -6356776.868670
v -46.079180 16.198689 -6356780.509661

Thanks Alexey,
It was exported with the local co-ord system but it is giving me a big number.
Can I fix this in Agi as not to go through subtracting numbers at export? I go through a lot of scans and doing this would not be ideal for my workflow.  I go in and out of Agi, modifying meshes and re-importing as well as sending this data to outsourcers [which would catch people out and cause delays].

Would you take a look at this script we've been using for literally years? It was made a long time ago, maybe it needs updating?
My process is to scale the object with two points and a scale bar to a size that works in my 3D software.
I then run this script to orient the model to the rotation I need by manipulating the bounding box
-maybe this is were the error is creeping in?

Thanks for your help

11
General / obj corrupted on export
« on: December 02, 2017, 01:24:02 AM »
Hi,
I'm getting an issue when exporting a model [see pic]
i'm running the beta 1.4.0.5432 but I don't think that's the issue in this case as other models have exported fine.
I have a vague recollection of someone having this problem before but I can't find it on the forums
I've tried rebuilding the mesh several times but to no avail, I've also tried on three separate machines [with different nvidia GPUs] with their own version of Agi Pro.
As you can see in the pic the 3d mesh is fine in agi but when i import it to ZBrush, 3DMax or Meshlab it comes in corrupted.
The only difference in this scan was i went from a low sparse cloud to medium dense cloud to 'high' face count poly model.
Thanks for any help

12
Python and Java API / Re: Rotate Region by a specific angle
« on: October 14, 2015, 07:06:02 PM »
Hi Alexey,
It's just a standard chunk, nothing special.
cheers

13
Python and Java API / Rotate Region by a specific angle
« on: October 13, 2015, 09:53:26 PM »
Hi,
I'm new to python and i'm trying to rotate my region by a specified angle.
I'm stuck on how to do this with my limited python skills!
would someone steer me in the right direction?
Here's what i have at the moment - i seem to be able to reset my region (now commented out) but not rotate it.
Ideally i want to rotate in a direction by 90 degrees.
thanks for your help!

Code: [Select]
import PhotoScan
import math

doc = PhotoScan.app.document
chunk = doc.chunks[0]
reg = chunk.region

#<---- Rotation ---- i've put random numbers in here>
reg.rot = PhotoScan.Matrix( [[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]] ).t

#chunk.resetRegion()


print (reg.rot)
print (doc.chunks[0])

14
General / Re: PSX file not saving as expected
« on: October 07, 2015, 11:16:43 PM »
thanks for all the replies, very useful!

15
General / PSX file not saving as expected
« on: October 02, 2015, 06:51:13 PM »
Hi,
Hope you could shed some light on this problem i'm having.

I'm working with PSX files so i can network my processing to other machines.

I'll send off scan saved as a psx and do an align photos + optimize cameras. This is using 40 pics which are masked [I have to apply the masks manually without networking which is another subject]

I'll load it up when its done and get rid of rouge points and do some gradual selection on the sparse cloud.

The problem comes when i try to save over the psx with my changes and send it out to the other machines to work on.
The changes I make do not save into the psx file when i 'save' or even 'save as' over the original file.
If i do this it will just revert to the original sparse cloud.

The only way i can get the changes is to delete the save file and 'chunk' file and save a fresh psx.
Is there a good reason why i cant save over the original data?

thanks for your help

Pages: [1] 2