Go Back   AC3D Forums > General > AC3D General
Register FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Display Modes
Old 15th March 2006, 09:46 AM   #1
Spinner
Senior Member
Professional user
 
Join Date: May 2005
Posts: 147
Default AC3D6 - saving the background image setup

I've looked and cant see a answer anywhere, so...
Is there a save background images method in the new version?
I dont get to sit n model for hours, as all my modelling is done inbetween other obligations. I waste so much time setting up each session.
I love AC3D but this is a real issue for my use of it.
Thanks, and appologies if its been answered already
__________________
Spinner

Blessed are the cracks,
For they let in the light
Spinner is offline   Reply With Quote
Old 15th March 2006, 10:53 AM   #2
Andy
Administrator
Professional user
 
Andy's Avatar
 
Join Date: Jun 2003
Posts: 4,565
Default

Yes - there is a tool which saves the background image config to a file.
Andy is offline   Reply With Quote
Old 16th March 2006, 04:46 AM   #3
Spinner
Senior Member
Professional user
 
Join Date: May 2005
Posts: 147
Default

Thanks Andy
__________________
Spinner

Blessed are the cracks,
For they let in the light
Spinner is offline   Reply With Quote
Old 12th May 2006, 12:14 PM   #4
Spinner
Senior Member
Professional user
 
Join Date: May 2005
Posts: 147
Default

Andy,
I cant seem to find this option to save background images in AC3D6.
Could you direct me to the tool you spoke of, please?
__________________
Spinner

Blessed are the cracks,
For they let in the light
Spinner is offline   Reply With Quote
Old 12th May 2006, 12:45 PM   #5
Andy
Administrator
Professional user
 
Andy's Avatar
 
Join Date: Jun 2003
Posts: 4,565
Default script for loading and saving background image configs

Until we add a 'Scripts and mods' section on this forum - here's a script which adds loading and saving of the background images.

Save this text into a file called 'viewsave.tcl' and place the file in the 'scripts' folder which is within the AC3D program folder.

When AC3D starts it will read this script and add two items to the Tools menu.


Code:
# simple AC3D script that adds two items to tool menu - to save and load the background image setup	
# for AC3D 6 - 24th Jan 2006
	
proc saveview { viewid file} {

	# get the view entity
	set v [ac3d viewid_to_entity $viewid]

	#get the background image entity from the view
	set image [ac3d entity_get_value $v "background_image" ]

	if {$image != 0 } {
		# if there's an image, read the relavent values for the layout, along with the image name from the image entity
		set x [ac3d entity_get_value $v "background_image_xoffset" ]
		set y [ac3d entity_get_value $v "background_image_yoffset" ]
		set scale [ac3d entity_get_value $v "background_image_scale" ]
		set picname [ac3d entity_get_value $image "name"]
		
		puts $file "$viewid|$picname|$x|$y|$scale"
	}
}


proc save_view_config { } {

    set filename [tk_getSaveFile -title "Save bg image config" -filetypes {{"AC3D project" { acp }}} -defaultextension .acp ]

    if { $filename == "" } {
	    return
	}
	    

	set path [file dirname $filename]
	set file [open $filename w]

	saveview 0 $file
	saveview 1 $file
	saveview 2 $file
	saveview 3 $file

	close $file
}

proc load_view_config { } {

    set filename [tk_getOpenFile -title "Load bg image config" -filetypes {{"AC3D project" { acp }}} -defaultextension .acp ]

    if { $filename == "" } {
	    return
	}
	    
	set file [open $filename r]
	gets $file line
	while {$line != ""} {
#		puts $line
		set parts [split $line "|" ]
		set vid [lindex $parts 0]
		set bgname [lindex $parts 1]
		set x [lindex $parts 2]
		set y [lindex $parts 3]
		set scale [lindex $parts 4]

		#puts "view $vid bg image $bgname, $x $y, $scale"

		set vent [ac3d viewid_to_entity $vid]
		ac3d entity_set_value $vent background_image_xoffset $x
		ac3d entity_set_value $vent background_image_yoffset $y
		ac3d entity_set_value $vent background_image_scale $scale 
		ac3d load_background_image $bgname $vid
		ac3d redraw_all

		gets $file line
		}
}


add_tools_menu_item "Load background image config" load_view_config "Load a view configuration"
add_tools_menu_item "Save background image config" save_view_config "Save the view configuration"
Note that we decided not to add this information into the .ac files since it would break many systems which use .ac files to store geometry. In the future the .ac file format will probably be changed so that it can store information like the background image setup.
Andy is offline   Reply With Quote
Old 14th September 2009, 08:14 PM   #6
davidb45
Junior Member
Junior member
 
Join Date: Jan 2004
Posts: 6
Default Re: script for loading and saving background image configs

I could use this script. But it doesn't work in 6.5.28 for me. Any suggestions?
Thanks in advance.
davidb45 is offline   Reply With Quote
Old 15th September 2009, 05:04 AM   #7
Reino
Junior Member
Member
 
Join Date: Jan 2006
Location: Germany
Posts: 16
Default Re: AC3D6 - saving the background image setup

Well, it does for me in the same 6.5.28. You get additional functions under "Tools" ---> "Load background image config" and "Save background image config". Background image stays in size and place.
Reino is offline   Reply With Quote
Old 15th September 2009, 09:21 AM   #8
davidb45
Junior Member
Junior member
 
Join Date: Jan 2004
Posts: 6
Default Re: AC3D6 - saving the background image setup

I found the script "bgimageloadsave.tcl" on another thread last night. It seems to work great. I'm not sure what the problem was with "viewsave.tcl" except that it is a cut and paste script where "bgimageloadsave" is a download.

Thanks
davidb45 is offline   Reply With Quote
Old 19th December 2009, 08:30 PM   #9
turbopropdriver
Junior Member
Junior member
 
Join Date: Oct 2009
Posts: 3
Question Re: script for loading and saving background image configs

Quote:
Originally Posted by davidb45 View Post
I could use this script. But it doesn't work in 6.5.28 for me. Any suggestions?
Thanks in advance.
Andy, can you please advise how I can create a .TCL file,? I copied and pasted your above text into a text file with the complete ....tcl extension into the scripts folder, yet ,the program does not read it at loading.


Thanks for your help.

Turbopropdriver

Last edited by turbopropdriver; 20th December 2009 at 01:54 AM. Reason: missing phrase.
turbopropdriver is offline   Reply With Quote
Old 26th February 2010, 04:24 PM   #10
Box5
Member
Advanced member
 
Join Date: Apr 2009
Location: NW
Posts: 48
Default Re: script for loading and saving background image configs

wow, I wish I knew of this script before. I always have to replace my images each time I start modding.
Box5 is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -4. The time now is 01:57 PM.


AC3D Forum
(C) Inivis Limited 2020